discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: [OpenSCAD] Discuss Digest, Vol 38, Issue 19

J
jim.klessig
Sat, Jan 20, 2018 6:25 PM

Charlie wrote"What I really need is a function that allows the input of randomly spaced 3Dpoints and produces a 3D mesh surface."
I don't think such a function is even theoretically possible. It doesn't have sufficient constraints.It might be possible if you defined a subset of those points as a boundary edge, and constrained the surface to be limited in,some other fashion.
As an example if your random point cloud is defined as the corners of a cube, there are i think 18 different open non self intersecting surfaces that could be formed, at least 3 self intersecting ones, and all possible combinations of those. There is one closed surface ( the cube) and its combinations with the self intersecting surfaces.

Sent from my U.S. Cellular® Smartphone
-------- Original message --------From: discuss-request@lists.openscad.org Date: 1/20/18  9:00 AM  (GMT-08:00) To: discuss@lists.openscad.org Subject: Discuss Digest, Vol 38, Issue 19
Send Discuss mailing list submissions to
discuss@lists.openscad.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
or, via email, send a message with subject or body 'help' to
discuss-request@lists.openscad.org

You can reach the person managing the list at
discuss-owner@lists.openscad.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Discuss digest..."

Today's Topics:

   1. Re: Head light bezel (cbernhardt)
   2. Re: F5 works, but F6 gives: ERROR: CGAL error in
      CGAL_Nef_polyhedron3(): (Parkinbot)
   3. Re: F5 works, but F6 gives: ERROR: CGAL error in
      CGAL_Nef_polyhedron3(): (Chris Camacho)
   4. Re: F5 works, but F6 gives: ERROR: CGAL error in
      CGAL_Nef_polyhedron3(): (Ronaldo Persiano)


Message: 1
Date: Fri, 19 Jan 2018 13:38:36 -0700 (MST)
From: cbernhardt charlie@carols62.com
To: discuss@lists.openscad.org
Subject: Re: [OpenSCAD] Head light bezel
Message-ID: 1516394316092-0.post@n5.nabble.com
Content-Type: text/plain; charset=us-ascii

algotruneman wrote

Something beginning like this?

I used your suggestion and got close (see attached picture).
What I really need is a function that allows the input of randomly spaced 3D
points and produces a 3D mesh surface.  Is there such a function?
Thanks,
Charles
http://forum.openscad.org/file/t1309/beze2.jpg

--
Sent from: http://forum.openscad.org/


Message: 2
Date: Fri, 19 Jan 2018 14:00:15 -0700 (MST)
From: Parkinbot rudolf@parkinbot.com
To: discuss@lists.openscad.org
Subject: Re: [OpenSCAD] F5 works, but F6 gives: ERROR: CGAL error in
CGAL_Nef_polyhedron3():
Message-ID: 1516395615471-0.post@n5.nabble.com
Content-Type: text/plain; charset=UTF-8

JordanBrown wrote

I don't use polyhedra very much.? My top-level comment was that generating
STL files that don't follow the rules is rude.

If you buy a product or pay a lot money for the licence, the word "rude"
might apply ...

And a side comment that by a common-sense definition, a list of points
that's not coplanar is not a polyhedron face.

If you want constructive help it is a good idea to show some code that
misbehaves and - again - to test it with the latest development snapshot
first.

--
Sent from: http://forum.openscad.org/


Message: 3
Date: Fri, 19 Jan 2018 21:05:56 +0000
From: Chris Camacho chris@bedroomcoders.co.uk
To: discuss@lists.openscad.org
Subject: Re: [OpenSCAD] F5 works, but F6 gives: ERROR: CGAL error in
CGAL_Nef_polyhedron3():
Message-ID: 5021efab-04b0-b9bf-5dde-b6f2890194d8@bedroomcoders.co.uk
Content-Type: text/plain; charset=utf-8; format=flowed

On 19/01/18 21:00, Parkinbot wrote:

If you buy a product or pay a lot money for the licence, the word "rude"
might apply ...

On the contrary if its free (as in beer) and open source then it would
be "rude" to make some inappropriate output to a STL file, if not at
least because you're sure gonna get called out on it... in public... so
better to do it right....


Message: 4
Date: Fri, 19 Jan 2018 21:13:38 -0200
From: Ronaldo Persiano rcmpersiano@gmail.com
To: OpenSCAD general discussion discuss@lists.openscad.org
Subject: Re: [OpenSCAD] F5 works, but F6 gives: ERROR: CGAL error in
CGAL_Nef_polyhedron3():
Message-ID:
CA+i9EaBiRqTp2iGCK6PKVG3pav38hRTyiW4LeRLB+e5aHcWghg@mail.gmail.com
Content-Type: text/plain; charset="utf-8"

2018-01-19 3:52 GMT-02:00 Jordan Brown openscad@jordan.maileater.net:

And a side comment that by a common-sense definition, a list of points
that's not coplanar is not a polyhedron face.

?Most non-trivial sets of more than 3 points are not planar ?due to
floating point approximations. And some measure is necessary to cope with
the different number representations of OpenSCAD and CGAL. As far as I
know, OpenSCAD triangulates every polyhedron facet with more that 3
vertices precisely to avoid non-planarity issues. It can be argued that its
triangulation is not "optimal" in some sense but we cannot blame it for
doing this.

Polyhedron is a very flexible primitive. It is possible to define a
non-manifold and/or singular surfaces even with borders or multiple shells
with polyhedron. If degenerated faces are avoided, you can render it
nevertheless while no boolean operations is performed. That may be a hell
or a heaven depending on what you are doing or want to do.

What Uwe's workaround brought up is that the hull operator may "heal"
(most) defective polyhedron generating a valid solid with a manifold shell:
the convex hull of the polyhedron face vertices. That is nice, because
mathematically the hull operation does not require any structure linking
the points.

I don't think there is anything wrong with the current processing of
polyhedron. But...

Consider the following:

e = 5;

p = [ [0,0,   0],[10, 0,   0],[0,10,  0],[0,0,  10],
      [0,0,10+e],[10,10,10+e],[0,10,0+e],[10,0,0+e] ];

faces1 = [[0,1,2],
          [0,2,3],
          [0,3,1],
          [1,3,2]];

faces2 = [[4,6,5],
          [4,5,7],
          [4,7,6],
          [5,6,7]];

polyhedron(p, concat(faces1,faces2));

This polyhedron is really the union of a pair of tetrahedra provided that
the parameter e is positive. It can be boolean operated with another
primitive and renders fine. However, when I set the parameter e to 1e-6 and
union it with a cube, my 01.06 version running on Windows crashes. Worst
than that, setting e to 1e-5 I am able to render it unioned with a cube and
generate a STL file. Although the file is not defective (it represents
exactly the two tetrahedra with a small gap of about 1e-05) OpenSCAD
crashes when I try to import it.

Summarizing, my points are:
a) it is fine to define polyhedra that cannot be boolean operated because
they are not manifold;
b) it is fine that those polyhedra produce STL files that are not manifold
provided a warning is issued;
c) it is not fine that a STL file representing a manifold exported by
OpenSCAD cannot be imported by OpenSCAD.

Charlie wrote"What I really need is a function that allows the input of randomly spaced 3Dpoints and produces a 3D mesh surface." I don't think such a function is even theoretically possible. It doesn't have sufficient constraints.It might be possible if you defined a subset of those points as a boundary edge, and constrained the surface to be limited in,some other fashion. As an example if your random point cloud is defined as the corners of a cube, there are i think 18 different open non self intersecting surfaces that could be formed, at least 3 self intersecting ones, and all possible combinations of those. There is one closed surface ( the cube) and its combinations with the self intersecting surfaces. Sent from my U.S. Cellular® Smartphone -------- Original message --------From: discuss-request@lists.openscad.org Date: 1/20/18 9:00 AM (GMT-08:00) To: discuss@lists.openscad.org Subject: Discuss Digest, Vol 38, Issue 19 Send Discuss mailing list submissions to discuss@lists.openscad.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org or, via email, send a message with subject or body 'help' to discuss-request@lists.openscad.org You can reach the person managing the list at discuss-owner@lists.openscad.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Discuss digest..." Today's Topics:    1. Re: Head light bezel (cbernhardt)    2. Re: F5 works, but F6 gives: ERROR: CGAL error in       CGAL_Nef_polyhedron3(): (Parkinbot)    3. Re: F5 works, but F6 gives: ERROR: CGAL error in       CGAL_Nef_polyhedron3(): (Chris Camacho)    4. Re: F5 works, but F6 gives: ERROR: CGAL error in       CGAL_Nef_polyhedron3(): (Ronaldo Persiano) ---------------------------------------------------------------------- Message: 1 Date: Fri, 19 Jan 2018 13:38:36 -0700 (MST) From: cbernhardt <charlie@carols62.com> To: discuss@lists.openscad.org Subject: Re: [OpenSCAD] Head light bezel Message-ID: <1516394316092-0.post@n5.nabble.com> Content-Type: text/plain; charset=us-ascii algotruneman wrote > Something beginning like this? I used your suggestion and got close (see attached picture). What I really need is a function that allows the input of randomly spaced 3D points and produces a 3D mesh surface.  Is there such a function? Thanks, Charles <http://forum.openscad.org/file/t1309/beze2.jpg> -- Sent from: http://forum.openscad.org/ ------------------------------ Message: 2 Date: Fri, 19 Jan 2018 14:00:15 -0700 (MST) From: Parkinbot <rudolf@parkinbot.com> To: discuss@lists.openscad.org Subject: Re: [OpenSCAD] F5 works, but F6 gives: ERROR: CGAL error in CGAL_Nef_polyhedron3(): Message-ID: <1516395615471-0.post@n5.nabble.com> Content-Type: text/plain; charset=UTF-8 JordanBrown wrote > I don't use polyhedra very much.? My top-level comment was that generating > STL files that don't follow the rules is rude. If you buy a product or pay a lot money for the licence, the word "rude" might apply ... > And a side comment that by a common-sense definition, a list of points > that's not coplanar is not a polyhedron face. If you want constructive help it is a good idea to show some code that misbehaves and - again - to test it with the latest development snapshot first. -- Sent from: http://forum.openscad.org/ ------------------------------ Message: 3 Date: Fri, 19 Jan 2018 21:05:56 +0000 From: Chris Camacho <chris@bedroomcoders.co.uk> To: discuss@lists.openscad.org Subject: Re: [OpenSCAD] F5 works, but F6 gives: ERROR: CGAL error in CGAL_Nef_polyhedron3(): Message-ID: <5021efab-04b0-b9bf-5dde-b6f2890194d8@bedroomcoders.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed On 19/01/18 21:00, Parkinbot wrote: > If you buy a product or pay a lot money for the licence, the word "rude" > might apply ... On the contrary if its free (as in beer) and open source then it would be "rude" to make some inappropriate output to a STL file, if not at least because you're sure gonna get called out on it... in public... so better to do it right.... ------------------------------ Message: 4 Date: Fri, 19 Jan 2018 21:13:38 -0200 From: Ronaldo Persiano <rcmpersiano@gmail.com> To: OpenSCAD general discussion <discuss@lists.openscad.org> Subject: Re: [OpenSCAD] F5 works, but F6 gives: ERROR: CGAL error in CGAL_Nef_polyhedron3(): Message-ID: <CA+i9EaBiRqTp2iGCK6PKVG3pav38hRTyiW4LeRLB+e5aHcWghg@mail.gmail.com> Content-Type: text/plain; charset="utf-8" 2018-01-19 3:52 GMT-02:00 Jordan Brown <openscad@jordan.maileater.net>: > And a side comment that by a common-sense definition, a list of points > that's not coplanar is not a polyhedron face. > ?Most non-trivial sets of more than 3 points are not planar ?due to floating point approximations. And some measure is necessary to cope with the different number representations of OpenSCAD and CGAL. As far as I know, OpenSCAD triangulates every polyhedron facet with more that 3 vertices precisely to avoid non-planarity issues. It can be argued that its triangulation is not "optimal" in some sense but we cannot blame it for doing this. Polyhedron is a very flexible primitive. It is possible to define a non-manifold and/or singular surfaces even with borders or multiple shells with polyhedron. If degenerated faces are avoided, you can render it nevertheless while no boolean operations is performed. That may be a hell or a heaven depending on what you are doing or want to do. What Uwe's workaround brought up is that the hull operator may "heal" (most) defective polyhedron generating a valid solid with a manifold shell: the convex hull of the polyhedron face vertices. That is nice, because mathematically the hull operation does not require any structure linking the points. I don't think there is anything wrong with the current processing of polyhedron. But... Consider the following: e = 5; p = [ [0,0,   0],[10, 0,   0],[0,10,  0],[0,0,  10],       [0,0,10+e],[10,10,10+e],[0,10,0+e],[10,0,0+e] ]; faces1 = [[0,1,2],           [0,2,3],           [0,3,1],           [1,3,2]]; faces2 = [[4,6,5],           [4,5,7],           [4,7,6],           [5,6,7]]; polyhedron(p, concat(faces1,faces2)); This polyhedron is really the union of a pair of tetrahedra provided that the parameter e is positive. It can be boolean operated with another primitive and renders fine. However, when I set the parameter e to 1e-6 and union it with a cube, my 01.06 version running on Windows crashes. Worst than that, setting e to 1e-5 I am able to render it unioned with a cube and generate a STL file. Although the file is not defective (it represents exactly the two tetrahedra with a small gap of about 1e-05) OpenSCAD crashes when I try to import it. Summarizing, my points are: a) it is fine to define polyhedra that cannot be boolean operated because they are not manifold; b) it is fine that those polyhedra produce STL files that are not manifold provided a warning is issued; c) it is not fine that a STL file representing a manifold exported by OpenSCAD cannot be imported by OpenSCAD.
C
cbernhardt
Tue, Jan 23, 2018 2:16 AM

jim_klessig wrote

I don't think such a function is even theoretically possible. It doesn't
have sufficient constraints.It might be possible if you defined a subset
of those points as a boundary edge, and constrained the surface to be
limited in,some other fashion.
As an example if your random point cloud is defined as the corners of a
cube, there are i think 18 different open non self intersecting surfaces
that could be formed, at least 3 self intersecting ones, and all possible
combinations of those. There is one closed surface ( the cube) and its
combinations with the self intersecting surfaces.

Actually it is possible, but probably not inside OpenSCAD.  Many years ago I
was in the land surveying business and I wrote a routine to take randomly
spaced 3D points and turn them into a topo (contour) map.  This was done
inside of AutoCAD.  I saved my headlight bezel as an STL file and imported
it into AutoCAD, then drew some 3D POINTS to represent the area I needed to
fill.  The program I wrote produces a TIN (Triangulated Irregular Network)
of the surface defined by the 3D points.  This particular TIN has 4315 3D
points.  I converted the TIN to an STL and added it to the OpenSCAD file.
See the area circled in red in the attached picture.
http://forum.openscad.org/file/t1309/tin_fillet.jpg

--
Sent from: http://forum.openscad.org/

jim_klessig wrote > I don't think such a function is even theoretically possible. It doesn't > have sufficient constraints.It might be possible if you defined a subset > of those points as a boundary edge, and constrained the surface to be > limited in,some other fashion. > As an example if your random point cloud is defined as the corners of a > cube, there are i think 18 different open non self intersecting surfaces > that could be formed, at least 3 self intersecting ones, and all possible > combinations of those. There is one closed surface ( the cube) and its > combinations with the self intersecting surfaces. Actually it is possible, but probably not inside OpenSCAD. Many years ago I was in the land surveying business and I wrote a routine to take randomly spaced 3D points and turn them into a topo (contour) map. This was done inside of AutoCAD. I saved my headlight bezel as an STL file and imported it into AutoCAD, then drew some 3D POINTS to represent the area I needed to fill. The program I wrote produces a TIN (Triangulated Irregular Network) of the surface defined by the 3D points. This particular TIN has 4315 3D points. I converted the TIN to an STL and added it to the OpenSCAD file. See the area circled in red in the attached picture. <http://forum.openscad.org/file/t1309/tin_fillet.jpg> -- Sent from: http://forum.openscad.org/