Polyhedron rendering bug?

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

Polyhedron rendering bug?

Jesse Donaldson
Hi folks,

I've written some code to generate polyhedrons, and they seem to render fine in preview mode, but when I compile & render it with CGAL, OpenSCAD crashes.
This happens with both the 2010.5 release, and the latest posted development snapshots.  I didn't try building from the latest sources.  I'm on MacOS X, 10.5.8.


Here's a small sample:

polyhedron(points=[[30,0,50],[0,30,50],[-30,0,50],[0,-30,50],[0,0,50],[30,0,0],[0,30,0],[-30,0,0],[0,-30,0],[0,0,0]], triangles=[[3,0,4],[0,1,4],[1,2,4],[2,3,4],[0,3,8],[5,0,8],[1,0,5],[6,1,5],[2,1,6],[7,2,6],[3,2,7],[8,3,7],[8,5,9],[5,6,9],[6,7,9],[7,8,9]], convexity=2);


And here's the output on the console:
12/22/10 9:26:02 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824] SystemFlippers: didn't consume all data for long ID 0 (pBase = 0x114835fb0, p = 0x114835fb4, pEnd = 0x114835fb8) 
12/22/10 9:26:02 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824] SystemFlippers: didn't consume all data for long ID 0 (pBase = 0x114819a50, p = 0x114819a54, pEnd = 0x114819a58) 
12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824]   
12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824] CGAL::Polyhedron_incremental_builder_3<HDS>:: 
12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824] lookup_halfedge(): input error: facet dyld: lazy symbol binding failed: Symbol not found: __ZNSo9_M_insertImEERSoT_ 
12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824]   Referenced from: /Users/jessedonaldson/Downloads/OpenSCAD.app/Contents/MacOS/OpenSCAD 
12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824]   Expected in: /usr/lib/libstdc++.6.dylib 
12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824] dyld: Symbol not found: __ZNSo9_M_insertImEERSoT_ 
12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824]   Referenced f 
12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824] rom: /Users/jessedonaldson/Downloads/OpenSCAD.app/Contents/MacOS/OpenSCAD 
12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824]   Expected in: /usr/lib/libstdc++.6.dylib 
12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824]   Expected in: /usr/lib/libstdc++.6.dylib 
12/22/10 10:05:15 PM com.apple.launchd[87] ([0x0-0x21f21f].org.openscad.OpenSCAD[8824]) Exited abnormally: Trace/BPT trap 




Reply | Threaded
Open this post in threaded view
|

Re: Polyhedron rendering bug?

Giles Bathgate-2
On Wed, 2010-12-22 at 22:09 -0800, Jesse Donaldson wrote:

> Hi folks,
>
>
> I've written some code to generate polyhedrons, and they seem to
> render fine in preview mode, but when I compile & render it with CGAL,
> OpenSCAD crashes.
> This happens with both the 2010.5 release, and the latest posted
> development snapshots.  I didn't try building from the latest
> sources.  I'm on MacOS X, 10.5.8.
>

It might be that your "polygons are not oriented the same way"

see:
http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#polyhedron

Regards

Giles



Reply | Threaded
Open this post in threaded view
|

Re: Polyhedron rendering bug?

kintel
Administrator
In reply to this post by Jesse Donaldson
On Dec 23, 2010, at 07:09 AM, Jesse Donaldson wrote:

> This happens with both the 2010.5 release, and the latest posted development snapshots.  I didn't try building from the latest sources.  I'm on MacOS X, 10.5.8.
>
> 12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824]   Expected in: /usr/lib/libstdc++.6.dylib
> 12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824] dyld: Symbol not found: __ZNSo9_M_insertImEERSoT_

It looks like you've stumbled across a 10.5 vs. 10.6 incompatibility. The binaries are compiled on 10.6 and should be backwards compatible with 10.5 but evidently my tests aren't covering all cases. This needs to be investigated further (i.e. I need to get myself a 10.5 test installation).
Could you try running OpenSCAD in both 32-bit and 64-bit mode to check if you get the same errors in both?

32-bit mode: Select icon -> Cmd-I -> "Open in 32-bit mode" checkbox

Of course, you might be able to work around this by not hitting whatever (unknown) code path triggers it, like Giles started to suggest.

 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: Polyhedron rendering bug?

Jesse Donaldson
The same error occurs under 32bit mode.

I tried to pay attention to triangle orientation, but I'll double check... the "bottom" might actually be reversed since it's generated the same way as the "top".

FWIW, the docs indicate that badly oriented triangles no longer cause a crash (as of March), but on my system they do still seem to crash.  In that case, though, I see this error in the console which does not appear for the crash when rendering my polyhedrons:

12/23/10 7:49:40 AM [0x0-0x29e29e].org.openscad.OpenSCAD[10079] lookup_halfedge(): input error: facet  

All the other details of the crash are the the same though -- looks like it's the same missing symbol.

Thanks to you both for your replies.
If there's anything else I can do to help, please let me know.
If I find some time, I'll see if I can get it building on my system.


Jesse


On Thu, Dec 23, 2010 at 3:38 AM, Marius Kintel <[hidden email]> wrote:
On Dec 23, 2010, at 07:09 AM, Jesse Donaldson wrote:

> This happens with both the 2010.5 release, and the latest posted development snapshots.  I didn't try building from the latest sources.  I'm on MacOS X, 10.5.8.
>
> 12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824]   Expected in: /usr/lib/libstdc++.6.dylib
> 12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824] dyld: Symbol not found: __ZNSo9_M_insertImEERSoT_

It looks like you've stumbled across a 10.5 vs. 10.6 incompatibility. The binaries are compiled on 10.6 and should be backwards compatible with 10.5 but evidently my tests aren't covering all cases. This needs to be investigated further (i.e. I need to get myself a 10.5 test installation).
Could you try running OpenSCAD in both 32-bit and 64-bit mode to check if you get the same errors in both?

32-bit mode: Select icon -> Cmd-I -> "Open in 32-bit mode" checkbox

Of course, you might be able to work around this by not hitting whatever (unknown) code path triggers it, like Giles started to suggest.

 -Marius

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

Reply | Threaded
Open this post in threaded view
|

Re: Polyhedron rendering bug?

Jesse Donaldson
Just wanted to follow up -- Giles was absolutely right, and the issue was just that my "bottom" triangles were backwards.  My polyhedron of 80,000 triangles now renders fine (if a bit sluggishly).  Thanks for the help, and sorry for the "false alarm".  I really hadn't expected a crash in that case. :-)


Jesse

On Thu, Dec 23, 2010 at 7:59 AM, Jesse Donaldson <[hidden email]> wrote:
The same error occurs under 32bit mode.

I tried to pay attention to triangle orientation, but I'll double check... the "bottom" might actually be reversed since it's generated the same way as the "top".

FWIW, the docs indicate that badly oriented triangles no longer cause a crash (as of March), but on my system they do still seem to crash.  In that case, though, I see this error in the console which does not appear for the crash when rendering my polyhedrons:

12/23/10 7:49:40 AM [0x0-0x29e29e].org.openscad.OpenSCAD[10079] lookup_halfedge(): input error: facet  

All the other details of the crash are the the same though -- looks like it's the same missing symbol.

Thanks to you both for your replies.
If there's anything else I can do to help, please let me know.
If I find some time, I'll see if I can get it building on my system.


Jesse


On Thu, Dec 23, 2010 at 3:38 AM, Marius Kintel <[hidden email]> wrote:
On Dec 23, 2010, at 07:09 AM, Jesse Donaldson wrote:

> This happens with both the 2010.5 release, and the latest posted development snapshots.  I didn't try building from the latest sources.  I'm on MacOS X, 10.5.8.
>
> 12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824]   Expected in: /usr/lib/libstdc++.6.dylib
> 12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824] dyld: Symbol not found: __ZNSo9_M_insertImEERSoT_

It looks like you've stumbled across a 10.5 vs. 10.6 incompatibility. The binaries are compiled on 10.6 and should be backwards compatible with 10.5 but evidently my tests aren't covering all cases. This needs to be investigated further (i.e. I need to get myself a 10.5 test installation).
Could you try running OpenSCAD in both 32-bit and 64-bit mode to check if you get the same errors in both?

32-bit mode: Select icon -> Cmd-I -> "Open in 32-bit mode" checkbox

Of course, you might be able to work around this by not hitting whatever (unknown) code path triggers it, like Giles started to suggest.

 -Marius

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


Reply | Threaded
Open this post in threaded view
|

Re: Polyhedron rendering bug?

Giles Bathgate-2

Glad to hear you solved the problem. It still shouldn't crash (at least with the latest version) so hopefully this issue can still be diagnosed.

On 29 Dec 2010 18:19, "Jesse Donaldson" <[hidden email]> wrote:
> Just wanted to follow up -- Giles was absolutely right, and the issue was
> just that my "bottom" triangles were backwards. My polyhedron of 80,000
> triangles now renders fine (if a bit sluggishly). Thanks for the help, and
> sorry for the "false alarm". I really hadn't expected a crash in that case.
> :-)
>
>
> Jesse
>
> On Thu, Dec 23, 2010 at 7:59 AM, Jesse Donaldson
> <[hidden email]>wrote:
>
>> The same error occurs under 32bit mode.
>>
>> I tried to pay attention to triangle orientation, but I'll double check...
>> the "bottom" might actually be reversed since it's generated the same way as
>> the "top".
>>
>> FWIW, the docs indicate that badly oriented triangles no longer cause a
>> crash (as of March), but on my system they do still seem to crash. In that
>> case, though, I see this error in the console which does not appear for the
>> crash when rendering my polyhedrons:
>>
>> 12/23/10 7:49:40 AM [0x0-0x29e29e].org.openscad.OpenSCAD[10079]
>> lookup_halfedge(): input error: facet
>>
>> All the other details of the crash are the the same though -- looks like
>> it's the same missing symbol.
>>
>> Thanks to you both for your replies.
>> If there's anything else I can do to help, please let me know.
>> If I find some time, I'll see if I can get it building on my system.
>>
>>
>> Jesse
>>
>>
>> On Thu, Dec 23, 2010 at 3:38 AM, Marius Kintel <[hidden email]> wrote:
>>
>>> On Dec 23, 2010, at 07:09 AM, Jesse Donaldson wrote:
>>>
>>> > This happens with both the 2010.5 release, and the latest posted
>>> development snapshots. I didn't try building from the latest sources. I'm
>>> on MacOS X, 10.5.8.
>>> >
>>> > 12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824]
>>> Expected in: /usr/lib/libstdc++.6.dylib
>>> > 12/22/10 10:05:11 PM [0x0-0x21f21f].org.openscad.OpenSCAD[8824] dyld:
>>> Symbol not found: __ZNSo9_M_insertImEERSoT_
>>>
>>> It looks like you've stumbled across a 10.5 vs. 10.6 incompatibility. The
>>> binaries are compiled on 10.6 and should be backwards compatible with 10.5
>>> but evidently my tests aren't covering all cases. This needs to be
>>> investigated further (i.e. I need to get myself a 10.5 test installation).
>>> Could you try running OpenSCAD in both 32-bit and 64-bit mode to check if
>>> you get the same errors in both?
>>>
>>> 32-bit mode: Select icon -> Cmd-I -> "Open in 32-bit mode" checkbox
>>>
>>> Of course, you might be able to work around this by not hitting whatever
>>> (unknown) code path triggers it, like Giles started to suggest.
>>>
>>> -Marius
>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> [hidden email]
>>> http://rocklinux.net/mailman/listinfo/openscad
>>>
>>
>>