Coder Social home page Coder Social logo

too much recursion about openjscad.org HOT 6 CLOSED

jscad avatar jscad commented on July 28, 2024
too much recursion

from openjscad.org.

Comments (6)

bmcage avatar bmcage commented on July 28, 2024

Further investigation shows this is due to end point and begin point of polygon being equal.

Simple test case to see this:

function main() {    
    var points = [new CSG.Vector2D(0,0)];
    points[1] = new CSG.Vector2D(0,10);
    points[2] = new CSG.Vector2D(10,10);
    points[3] = new CSG.Vector2D(0,0);
    var shape1 = CAG.fromPoints( points );
   return shape1;
}

At a minimum, a clear error to the user when begin and endpoint are equal would be nicest. Allowing begin=end would nicer still!

from openjscad.org.

bmcage avatar bmcage commented on July 28, 2024

test in openscad shows that begin=end is allowed there. Just paste:

polygon( points=[[0,0],[2,1],[1,2],[1,3],[3,4],[0,5],[0,0] ]);

and press F5 and F6.

from openjscad.org.

richievos avatar richievos commented on July 28, 2024

@bmcage could you submit a pull request making that compatible with OpenSCAD's way of doing things? I haven't personally run into this, but seems like a quick fix.

from openjscad.org.

bmcage avatar bmcage commented on July 28, 2024

@richievos I don't have a patch, so not sure what you mean with a pull request. I would expect opening an issue to be the only step possible at the moment.

You hit the same bug when internal points are double. I have that in some procedurs for simplicity of code, eg a kerf on a lasercutter. If you set kerf=0, my procedures make polygons with twice the same point, which works in openscad, but not in openJSCAD, For openJSCAD, I need to add if then blocks testing on the 0.

from openjscad.org.

bebbi avatar bebbi commented on July 28, 2024

fixed in joostn/OpenJsCad#54
See also #33

from openjscad.org.

z3dev avatar z3dev commented on July 28, 2024

I tested the examples from @bmcage using Release 0.3.0. Both render properly. I'm closing this issue.

from openjscad.org.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.