jscad / OpenJSCAD.org

JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.
https://openjscad.xyz/
MIT License
2.66k stars 515 forks source link

Question: clarify orientation of skew cylinders/cones #163

Closed BenW0 closed 7 years ago

BenW0 commented 8 years ago

When I create a CSG.cylinder object, I expect a cylinder parallel to the line between start and end, with flat end caps perpendicular to the line. However, when I execute the following in openjscad.org (or the debugger on openjscad.github.io), I obtain a cylinder with skewed end caps, not at all what I was expecting.

function main(){
    return CSG.cylinder({start:[0,0,0], end:[2, 2, 2], radiusStart:1, radiusEnd:1});
}

Output as I see it:

cylinder

This is not the case if any one of the end coordinate elements is 0 (i.e. the cylinder lies in one of the x/y/z planes).

If this is the intended behavior, could you help me understand what is going on? I will be happy to submit a documentation patch once I get my head around what CSG.cylinder() is supposed to do so I can write one.

Thanks

z3dev commented 7 years ago

This issue was moved to jscad/csg.js#19