[OpenSCAD] General approach

nop head nop.head at gmail.com
Mon Jul 8 11:39:54 EDT 2019


The only exact rotations that can be relied on are by multiples of 90
degrees. If you rotate by 120 you get sqrt(0.75) factors in the matrix
which are irrational.

will OpenSCAD excute rotate in floating point representation?

Yes using matrices of doubles.

> Will OpenSCAD really convert the result of the union twice before
difference is called?

I think it depends if you have render anywhere and if you do an F5 before
an F6. If you clear the cache and do F6 it tends to keep things in CGAL
notation and give a cleaner result.

On Mon, 8 Jul 2019 at 16:18, Dan Shriver <tabbydan at gmail.com> 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.
>
> I later figured that since I was trying to join two things that were in
> different octants (which crossed over slightly at the end) would be to
> subtract a box that was in the other octant.
>
> One concern I do have is that this makes 1/3 of my hallways and the rest
> would be made by 120 degree rotations.  Earlier in this thread someone was
> noting that various rotations would give irrational numbers (maybe this
> isn't any worse than the standard floating point, because they are just
> implicitly 'rounded' into something nearby that isn't irrational?).  How
> does one avoid doing a rotation operation which is "bad"?  Is there a
> "safe" way to do rotations?
>
> On Mon, Jul 8, 2019 at 10:12 AM Parkinbot <rudolf at digitaldocument.de>
> wrote:
>
>> nophead wrote
>> >>
>> >> CGAL may be slow, but the architects' decision to build on a rational
>> >> number representation had good reasons .
>> > Yes but OpenSCAD gains zero advantage from this because it converts back
>> > to
>> > doubles and snaps to a grid and then feeds the results back to CGAL.
>>
>> I am aware that CGAL only internally gains advantage of this and that it
>> would be a large progress (and amount of work), if OpenSCAD didn't dismiss
>> CGAL representations when looping, respectively if OpenSCAD also supported
>> transformations in CGAL-representation to avoid such conversions for all
>> intermediate steps. This would reduce the need of conversions to I/O
>> operations only.
>>
>> What I don't know is, how many loops OpenSCAD actually uses when it
>> renders
>> a design. So what happens exactly for
>>
>> difference()
>> {
>>   union() {A(); B();}
>>   C();
>> }
>>
>> with A(), B(), C() defined as modules with visual output? Will OpenSCAD
>> really convert the result of the
>> union twice before difference is called?
>>
>> And here:
>>
>> difference()
>> {
>>   rotate(45)
>>   union() {A(); B();}
>>   C();
>> }
>>
>> will OpenSCAD excute rotate in floating point representation?
>>
>>
>>
>> --
>> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20190708/ce5cc738/attachment.html>


More information about the Discuss mailing list