# Yet another coincident point problem...

4 messages
Open this post in threaded view
|

## Yet another coincident point problem...

 Folks,         I have what I'm fairly sure is another problem with         OpenSCAD not properly recognising coincident points         when it sees them.         I was trying to learn how to use children objects in         OpenSCAD modules when I ran across this.  There are         60 degree angles involved but I went out of my way to         keep things as rational as possible.  Even so, that         pesky sqrt(3)/2 just HAS TO appear one way or another.         I include the code below.  It is short.         I can't tell from looking at it if OpenSCAD is having         the problem or the rendering is the problem.  As such,         I cannot tell whether to ignore it & proceed or try         some other approach.         I know the recommendation will be to overlap the         objects but, really, the problem is in how coincident         points are recognised not in improper overlap.         And the solution is not to be found in higher precision.         Plain old 64-bit double precision is more than adequate.         It is the coincidence test that needs to be changed.         Sorry about the rant but overlapping is contrary to         where I'm going with this code.         Yours,                                 Dan module triplicate(s) {         for (i = [0:3]) rotate([0,0,120*i]) translate([-s/3,0])                 rotate([0,0,60]) translate([s/6,0]) child(0); } module flakeSide(s) {         polygon(points = [[-s/2, 0], [0, -sqrt(3)*s/6], [s/2, 0]]); } module flake0Body(s, n, rs, c) {         if (s - 6*n*(2*rs + c)/sqrt(3) > 0)                 triplicate(s - 6*n*(2*rs + c)/sqrt(3))                         flakeSide(s - 6*n*(2*rs + c)/sqrt(3));         else cube([2,2,2], center = true); /* just an error case */ } translate([0,0]) difference() {         flake0Body(9,0,1/2,1/10);         flake0Body(9,1,1/2,1/10); }
Open this post in threaded view
|

## Re: Yet another coincident point problem...

 Administrator On Jul 9, 2010, at 03:17 AM, Dan Zuras 3D wrote: > I can't tell from looking at it if OpenSCAD is having > the problem or the rendering is the problem.  As such, > I cannot tell whether to ignore it & proceed or try > some other approach. This is just a rendering glitch in 2D mode. You can verify this by e.g.: o Render using CGAL (F6): You will now get a 2D plane with red outlines showing that the 2D objects was unioned correctly o Add a linear_extrude() -> the bug wil go away. ..at least this is the behavior on my machine (64-bit Mac build). ~/= Marius -- We are Elektropeople for a better living.