Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code works in OpenSCAD, but not https://openjscad.xyz/ - it says 'SyntaxError: Unexpected identifier 'plant_marker' #1370

Closed
andytriboletti opened this issue Nov 27, 2024 · 1 comment

Comments

@andytriboletti
Copy link

Expected Behavior

I expect the website to render the code like the desktop app does.

Actual Behavior

I get an error:

SyntaxError: Unexpected identifier 'plant_marker'

Object.<anonymous> (changes.js:0:0)

Steps to Reproduce the Problem

  1. I asked openai to write some openscad code. It works on the desktop app but not on the website.
  2. Here's the code that works on desktop but not on openjscad.xyz:
// Parameters for customization
module plant_marker(label_text="Lavender", width=80, height=20, thickness=2, stake_length=50, font_size=10) {
    // Label area
    difference() {
        // Main label body
        cube([width, height, thickness], center=false);
        // Text cutout
        translate([5, height/2 - font_size/2, thickness + 0.1])  // Adjust text position
            linear_extrude(height=thickness + 0.1)
                text(label_text, size=font_size, valign="center", halign="left", font="Liberation Sans");
    }
    
    // Stake
    translate([width/2 - 5, -stake_length, 0]) // Centering the stake under the label
        cube([10, stake_length, thickness], center=false); // Stake dimensions
}

// Customize your plant label
plant_marker(label_text="Lavender", width=100, height=30, thickness=3, stake_length=60, font_size=12);

Specifications

  • Version: Using the website https://openjscad.xyz/ on Mac on Chrome
  • Platform:
  • Environment: (browser, local server, node.js etc)
@z3dev
Copy link
Member

z3dev commented Nov 30, 2024

Duplicate. Same as #1369

@z3dev z3dev closed this as completed Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants