If we change the test in lhs_faces() to:
cosine_between(normal(points), points[0]-centroid(vertices)) < 0
it works for both cases. Anyway, this strategy of using centroid will
possibly work for all convex objects but it will not work, for instance,
for a holed cube.
BTW, your example is not a manifold.
2017-04-10 16:44 GMT-03:00 kitwallace kit.wallace@gmail.com:
Odd - works for me.
--
View this message in context: http://forum.openscad.org/
polyhedron-to-a-3D-printing-from-tp18692p21164.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Still don't see why your second case doesn't work for you - maybe it's a
version thing - I'm on 2017.01.20 but its hard to see why a simple
translation would affect anything.
BTW It's not my example , its the OP's
--
View this message in context: http://forum.openscad.org/polyhedron-to-a-3D-printing-from-tp18692p21171.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Sorry, but I got the same result with both 2017.01.20 and 2015.03-2 running
under Windows 7 what is really odd.
http://forum.openscad.org/file/n21176/TT.png
And the reason of this failure is simple: in lhs_faces, your test uses the
angle between a vector (the face normal) and a point (the centroid). This
has no geometrical meaning.
Even correcting this, the strategy may fail for non convex objects, as I
said before.
--
View this message in context: http://forum.openscad.org/polyhedron-to-a-3D-printing-from-tp18692p21176.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Ronaldo - you are right of course -my apologies for wasting your time - I was
over confident and must have slipped out of thrown together mode . There
must have been a regression in the code because I use this to clean up
Johnson solids which have occasional reversed faces
Chris
--
View this message in context: http://forum.openscad.org/polyhedron-to-a-3D-printing-from-tp18692p21178.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OK, I was looking in the wrong place - it isn't the code, it's the data.
I've tested the code and it is correct when the solid is convex (a known
limitation). The problem is that this example is not convex - I think the
apex of the bottom facet is wrong , and hence its not manifold.
Re cosine - the centroid point defines a line from the origin to the
centroid so the angle is well-defined
Chris
--
View this message in context: http://forum.openscad.org/polyhedron-to-a-3D-printing-from-tp18692p21179.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
2017-04-10 21:31 GMT-03:00 kitwallace kit.wallace@gmail.com:
Re cosine - the centroid point defines a line from the origin to the
centroid so the angle is well-defined
Sorry to disagree again. Translating the model I can put the centroid
anywhere I like. So the angle between the normal of a face (invariant to
translation) and the vector centroid-[0,0,0] may be any value I want. So
the test is not invariant to translation. But the face winding is.
Besides, what happens when the centroid happens to be the origin? All
faces, independent of its winding will pass the test.
Yes of course. I recall this was a quick solution which works for the
polyhedra I was working on which are centred on the origin . i agree, it's
not a general solution at all.
On 11 Apr 2017 2:17 a.m., "Ronaldo [via OpenSCAD]" <
ml-node+s1091067n21181h3@n5.nabble.com> wrote:
2017-04-10 21:31 GMT-03:00 kitwallace <[hidden email]
http:///user/SendEmail.jtp?type=node&node=21181&i=0>:
Re cosine - the centroid point defines a line from the origin to the
centroid so the angle is well-defined
Sorry to disagree again. Translating the model I can put the centroid
anywhere I like. So the angle between the normal of a face (invariant to
translation) and the vector centroid-[0,0,0] may be any value I want. So
the test is not invariant to translation. But the face winding is.
Besides, what happens when the centroid happens to be the origin? All
faces, independent of its winding will pass the test.
OpenSCAD mailing list
[hidden email] http:///user/SendEmail.jtp?type=node&node=21181&i=1
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
If you reply to this email, your message will be added to the discussion
below:
http://forum.openscad.org/polyhedron-to-a-3D-printing-
from-tp18692p21181.html
To unsubscribe from polyhedron to a 3D printing from, click here
http://forum.openscad.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=18692&code=a2l0LndhbGxhY2VAZ21haWwuY29tfDE4NjkyfDE3Nzk2Mzg2MzQ=
.
NAML
http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
--
View this message in context: http://forum.openscad.org/polyhedron-to-a-3D-printing-from-tp18692p21182.html
Sent from the OpenSCAD mailing list archive at Nabble.com.