i don't understand this message. please help

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

i don't understand this message. please help

t1ntan
Hello to everybody on this list.

First time a big sorry for my bad english. I have problems to learn the english
language.
Thanks for your understanding.


I'm learning OpenSCAD since a few days.

I wrote a simple code in OpenSCAD

This module is a part in a library.

--- tripy.scad ---
// module for a library
module triangle_pyramid_base(length, height)
{
  a=sqrt((length * length) - ((length / 2) * (length / 2)));

polyhedron(points=[[(length/2),-(a/2),0],[-(length/2),-(a/2),0],[0,(a/2),0],[0,0,height]],triangles=[[0,1,2],[1,2,3],[0,1,3],[0,2,3]]);
}

triangle_pyramid_base(10, 20);
------------------

If i press the F5-button for "compile", two facets are purple.

If i press the F6-button for "compile and render", the view-windows is empty and
i get this message:
CGAL::Polyhedron_incremental_builder_3<HDS>::
lookup_halfedge(): input error: facet 1 shares a halfedge from vertex 0 to
vertex 1 with facet 0.

I don't have an idea what the problem is. I'd searched with google for an answer
but i don't find it.
Can you help me?

Thank you.

T1nt@n


___________________________________
c-mail, http://www.c-base.org




Reply | Threaded
Open this post in threaded view
|

Re: i don't understand this message. please help

kintel
Administrator
On Apr 17, 2011, at 01:31 AM, <[hidden email]> <[hidden email]> wrote:

> I don't have an idea what the problem is. I'd searched with google for an answer
> but i don't find it.
> Can you help me?
>
You need to specify all triangles with the same winding order (clockwise or counterclockwise).
This should work:

triangles=[[0,2,1],[1,2,3],[0,1,3],[0,3,2]]


 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: i don't understand this message. please help

Giles Bathgate-2
In reply to this post by t1ntan
On 17 April 2011 00:31,  <[hidden email]> wrote:
> module triangle_pyramid_base(length, height)

Are you looking to create a triangle based pyramid?

There is one in MCAD here:
https://github.com/SolidCode/MCAD/blob/master/regular_shapes.scad

Regards

Giles Bathgate