2d intersection on hierarchical module bug (works on flat import_dxf shape)

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

2d intersection on hierarchical module bug (works on flat import_dxf shape)

clothbot
Hi Marius,

When I was coding up my OpenSCAD variant of the new Open Hardware logo I ran into a case where OpenSCAD hangs indefinitely while trying to process some 2D modules.


Try compiling with "render_part=3" and "use_files=false" to observe the hanging behaviour.

- Compiling with "render_part=2" is fine and is used to generate the "static_files/oshw_logo_2d.dxf" referenced in "render_part==3".

- Compiling with "render_part=3" and "use_files=true" is fine, so there doesn't appear to be anything wrong with my shell_2d() module.

I've confirmed the problem still exists in the latest Mac .dmg posted a few minutes ago.

Andrew.

--

"The future is already here.  It's just not very evenly distributed" -- William Gibson

Me: http://clothbot.com/wiki/


Reply | Threaded
Open this post in threaded view
|

Re: 2d intersection on hierarchical module bug (works on flat import_dxf shape)

kintel
Administrator
Hi,

Looks like the problem is related to CSG normalization for OpenCSG. To render 2D objects with OpenCSG, need to give the objects a 3rd dimension (1 mm thickness). Somehow the CSG tree you're composing is extremely complex and the normalization process goes into an infinite or veery long-running loop.
In CGAL mode, it works as it should.

I think about how to deal with this.

On a related note: It looks like you'd like to have an inset operator : )

 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: 2d intersection on hierarchical module bug (works on flat import_dxf shape)

clothbot
Hi Marius,

Confirmed.  It only hangs on the Compile/F5 operation.  I didn't even think to try Compile and Render (CGAL)/F6; yes that works.  I'm so used to not bothering with F6 when F5 fails.

A fast inset operation would definitely be useful! :)

Andrew.

On 2011-04-13, at 10:58 AM, Marius Kintel wrote:

Hi,

Looks like the problem is related to CSG normalization for OpenCSG. To render 2D objects with OpenCSG, need to give the objects a 3rd dimension (1 mm thickness). Somehow the CSG tree you're composing is extremely complex and the normalization process goes into an infinite or veery long-running loop.
In CGAL mode, it works as it should.

I think about how to deal with this.

On a related note: It looks like you'd like to have an inset operator : )

-Marius

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

--

Makerbot Number Nine... #9... 0x09... 0o11... 0b1001... 
http://clothbot.com/wiki/MakerBotNumberNine



Reply | Threaded
Open this post in threaded view
|

Re: 2d intersection on hierarchical module bug (works on flat import_dxf shape)

Whosawhatsis
As a workaround, you can force CGAL compilation in an OpenCSG
rendering by using the render() statement. The problem may also go
away when you extrude the logo, as I believe 2D objects are rendered
with CGAL before they are extruded. If someone familiar with the code
knows whether this is the case, I'd be interested to know.

On Wed, Apr 13, 2011 at 8:59 AM, Andrew Plumb <[hidden email]> wrote:

> Hi Marius,
> Confirmed.  It only hangs on the Compile/F5 operation.  I didn't even think
> to try Compile and Render (CGAL)/F6; yes that works.  I'm so used to not
> bothering with F6 when F5 fails.
> A fast inset operation would definitely be useful! :)
> Andrew.
> On 2011-04-13, at 10:58 AM, Marius Kintel wrote:
>
> Hi,
>
> Looks like the problem is related to CSG normalization for OpenCSG. To
> render 2D objects with OpenCSG, need to give the objects a 3rd dimension (1
> mm thickness). Somehow the CSG tree you're composing is extremely complex
> and the normalization process goes into an infinite or veery long-running
> loop.
> In CGAL mode, it works as it should.
>
> I think about how to deal with this.
>
> On a related note: It looks like you'd like to have an inset operator : )
>
> -Marius
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>
> --
>
> Makerbot Number Nine... #9... 0x09... 0o11... 0b1001...
> http://clothbot.com/wiki/MakerBotNumberNine
>
>
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>
>

Reply | Threaded
Open this post in threaded view
|

Re: 2d intersection on hierarchical module bug (works on flat import_dxf shape)

clothbot
Ooooh! I never noticed that render() statement.  It definitely works.

It may also help speed up some of my other more complex OpenSCAD code.  I've often found myself wishing I didn't have to resort to intermediate DXF and STL files to speed up top-level boolean operations.

Thanks!

Andrew. 

On 2011-04-13, at 6:28 PM, Whosawhatsis wrote:

As a workaround, you can force CGAL compilation in an OpenCSG
rendering by using the render() statement. The problem may also go
away when you extrude the logo, as I believe 2D objects are rendered
with CGAL before they are extruded. If someone familiar with the code
knows whether this is the case, I'd be interested to know.

On Wed, Apr 13, 2011 at 8:59 AM, Andrew Plumb <[hidden email]> wrote:
Hi Marius,
Confirmed.  It only hangs on the Compile/F5 operation.  I didn't even think
to try Compile and Render (CGAL)/F6; yes that works.  I'm so used to not
bothering with F6 when F5 fails.
A fast inset operation would definitely be useful! :)
Andrew.
On 2011-04-13, at 10:58 AM, Marius Kintel wrote:

Hi,

Looks like the problem is related to CSG normalization for OpenCSG. To
render 2D objects with OpenCSG, need to give the objects a 3rd dimension (1
mm thickness). Somehow the CSG tree you're composing is extremely complex
and the normalization process goes into an infinite or veery long-running
loop.
In CGAL mode, it works as it should.

I think about how to deal with this.

On a related note: It looks like you'd like to have an inset operator : )

-Marius

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

--

Makerbot Number Nine... #9... 0x09... 0o11... 0b1001...
http://clothbot.com/wiki/MakerBotNumberNine




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


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

--

Makerbot Number Nine... #9... 0x09... 0o11... 0b1001... 
http://clothbot.com/wiki/MakerBotNumberNine



Reply | Threaded
Open this post in threaded view
|

Re: 2d intersection on hierarchical module bug (works on flat import_dxf shape)

kintel
Administrator
In reply to this post by Whosawhatsis
On Apr 14, 2011, at 00:28 AM, Whosawhatsis wrote:

> As a workaround, you can force CGAL compilation in an OpenCSG
> rendering by using the render() statement. The problem may also go
> away when you extrude the logo, as I believe 2D objects are rendered
> with CGAL before they are extruded. If someone familiar with the code
> knows whether this is the case, I'd be interested to know.
>

Yes in both cases.

The idea behind using OpenCSG was to optimize for rendering, but in this case it does the opposite. It might make sense to always evaluate the top-level 2D object with CGAL before passing anything to OpenCSG..

 -Marius