OpenSCAD crash (with small demo)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenSCAD crash (with small demo)

Alan Cox
I hit a crash with openscad due to the tool I'm writing generating bad
scad input

It reduces down to the following

linear_extrude(height=1.5)
scale([0,1.5,0])
linear_extrude(height=1.5)
square(4);

Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD crash (with small demo)

kintel
Administrator
Hi,

CGAL doesn't like scale factors of zero. The following example also crashes when rendered with CGAL:

scale([0,1,1]) cube();

There has been other issues with the CGAL transformations earlier, so perhaps we should at some point write our own replacement.
I'll be mostly offline the next three days - if anyone wants to take a crack at it, this method is a good place to start:

Response CGALEvaluator::visit(State &state, const TransformNode &node)

Cheers,

 -Marius
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD crash (with small demo)

Whosawhatsis
Scaling something to zero on one axis should probably be interpreted as a 2d projection (with slice=false) on the plane perpendicular to that axis, as you're essentially telling it to move all of the points to zero on that axis. This case could probably be caught before handing-off to CGAL without too much difficulty...

On Sunday, January 29, 2012 at 6:14 PM, Marius Kintel wrote:

Hi,

CGAL doesn't like scale factors of zero. The following example also crashes when rendered with CGAL:

scale([0,1,1]) cube();

There has been other issues with the CGAL transformations earlier, so perhaps we should at some point write our own replacement.
I'll be mostly offline the next three days - if anyone wants to take a crack at it, this method is a good place to start:

Response CGALEvaluator::visit(State &state, const TransformNode &node)

Cheers,

-Marius
_______________________________________________
OpenSCAD mailing list

Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD crash (with small demo)

nophead
I would of thought making it disappear completely is less unexpected that converting it to 2D. Otherwise you would have a thing that you didn't know if it was 2D or 3D and so could not operate on it.

On 30 January 2012 17:18, Whosawhatsis <[hidden email]> wrote:
Scaling something to zero on one axis should probably be interpreted as a 2d projection (with slice=false) on the plane perpendicular to that axis, as you're essentially telling it to move all of the points to zero on that axis. This case could probably be caught before handing-off to CGAL without too much difficulty...

On Sunday, January 29, 2012 at 6:14 PM, Marius Kintel wrote:

Hi,

CGAL doesn't like scale factors of zero. The following example also crashes when rendered with CGAL:

scale([0,1,1]) cube();

There has been other issues with the CGAL transformations earlier, so perhaps we should at some point write our own replacement.
I'll be mostly offline the next three days - if anyone wants to take a crack at it, this method is a good place to start:

Response CGALEvaluator::visit(State &state, const TransformNode &node)

Cheers,

-Marius
_______________________________________________
OpenSCAD mailing list


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad


Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD crash (with small demo)

kintel
Administrator
In reply to this post by Alan Cox
On Jan 30, 2012, at 02:18 AM, Alan Cox wrote:

> I hit a crash with openscad due to the tool I'm writing generating bad
> scad input
>
This is now fixed in master.
Thanks for the report and the minimal example!

 -Marius