Skip to content

V2 backwards compatibility with V1 #1326

@gfwilliams

Description

@gfwilliams

Sorry if this has been dealt with before, but I did have a didn't find it in my searches.

I just came back to an old script that I wanted to make a minor change to, and found it no longer works and there's no obvious way of using it any more. Is there any solution or easy way to 'upgrade' old scripts?

Expected Behavior

Script I made a year ago is still usable on https://openjscad.xyz/:

function main(params) {
return difference(
    union(
      cube({size:[20,20,20],center:true}),
      cube({size:[50,8,8],center:true}).translate([0,0,14]),
      cube({size:[20,8.5,8.5],center:true}).rotateX(45).translate([0,4,10]),
      cube({size:[20,8.5,8.5],center:true}).rotateX(45).translate([0,-4,10]),
      //cylinder({start: [-10,5,10], end: [10,5,10], r: 5, fn: 20}),
      //cylinder({start: [-10,-5,10], end: [10,-5,10], r: 5, fn: 20}),
      cube({size:[10,8,20],center:true}).rotateY(20).translate([9,0,5]),
      cube({size:[10,8,20],center:true}).rotateY(-20).translate([-9,0,5])
     ).expand(2,20),
      cube({size:[20,20,40],center:true}).translate([0,0,-10])
    );
}

Actual Behavior

Script fails with error about exports.main, after that, difference, after fixing that, size for cube not being a number

Steps to Reproduce the Problem

  1. Go to https://openjscad.xyz/:
  2. Try script above and shift+enter to execute

Specifications

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions