[OpenSCAD] General approach

nop head nop.head at gmail.com
Mon Jul 8 14:27:12 EDT 2019


Rotating a whole model doesn't usually cause problems but consider this:
suppose you have a flat face and you union a cube with it. The intersection
points  will be exactly on the plane and so it remains a flat plane with a
cube sticking out. Now rotate the plane so it is inclined. The intersection
points probably can't be exactly on the plane because all its vertices are
irrational. They will be the nearest grid points to where they should be
put then the plane is no longer exactly flat. It has to be made with
triangles. Whether that matters or not depends if you have some vertices
that are very close and the rounding causes them to merge. For example if
you have a knife edge it might collapse and become self intersecting. I
think this is the reason CGAL uses rationals.

Even translating a model can cause it to break because as you move away
from the origin floats get less accurate. So close vertices at the origin
may merge when translated away from it.

On Mon, 8 Jul 2019 at 18:53, Dan Shriver <tabbydan at gmail.com> wrote:

> Thanks nop head:  I was just concerned because people were saying "barf"
> etc.
> Small errors, loss in precision, are acceptable to me.  I just don't want
> a rotation to take a previously valid model and make it invalid.
>
> On Mon, Jul 8, 2019 at 12:14 PM nop head <nop.head at gmail.com> wrote:
>
>> You get rounding errors because it is impossible to represent exact
>> rotations numerically on a digital computer. Of course it is accurate
>> enough for real life but you can't rely vertex positions exactly meeting
>> for example.
>>
>>  Even without rotations you can't accurately stack two 0.1mm blocks
>> because 0.1 is a recurring fraction in binary. So it is safe to union two
>> 1mm cubes without any overlap but not two 0.1mm cubes. One needs to
>> understand how numbers work on a computer to be able to avoid problems.
>>
>> On Mon, 8 Jul 2019 at 16:51, Dan Shriver <tabbydan at gmail.com> wrote:
>>
>>> Nate: what I was asking in the original post was how to take 1/6th of
>>> the hallway design my head and make 1/3.  So yes it is a mirror operation.
>>> The best way to eliminate the stuff that overlapped the next octant turned
>>> out to be using a box.
>>>
>>> After that I take that whole shape and need to displace it and rotate it
>>> by 120 (I need to do that twice).
>>>
>>> Nop head: on the irrationals do I just get a rounding error or is there
>>> a more serious problem?  If it is a more serious problem is it possible to
>>> avoid it?
>>>
>>> On Mon, Jul 8, 2019 at 11:38 AM NateTG <nate-openscadforum at pedantic.org>
>>> wrote:
>>>
>>>> > ... So the extended discussion of the internals is interesting and
>>>> worthwhile but my original intent on the thread was to see if what I was
>>>> doing made sense geometrically.  Similar to the thread about taking
>>>> apart
>>>> the three cones that were joined. ...
>>>>
>>>> The stuff in the original post doesn't seem correct to me.  It seems
>>>> like
>>>> you're confusing rotation by 180 degrees with reflection.
>>>>
>>>> Can you try using:
>>>>
>>>> "rotate (v=[0,1,0], a=180)"
>>>>
>>>> instead of
>>>>
>>>> "mirror([1,0,0])"
>>>>
>>>> ?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Sent from: http://forum.openscad.org/
>>>>
>>>> _______________________________________________
>>>> OpenSCAD mailing list
>>>> Discuss at lists.openscad.org
>>>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> Discuss at lists.openscad.org
>>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>>>
>> _______________________________________________
>> OpenSCAD mailing list
>> Discuss at lists.openscad.org
>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>>
> _______________________________________________
> OpenSCAD mailing list
> Discuss at lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20190708/34a07f69/attachment.html>


More information about the Discuss mailing list