

Without seeing the code, my first guess would be that it looks like two
pieces because it is two pieces.
Even if the pieces are very close together, they may still be separate. You
could try wrapping the pieces together in a union:
union()
{
part1();
part2();
}
otherwise, post the minimal code needed to show the problem and some of the
people here can have a look.

Sent from: http://forum.openscad.org/_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


better open a new thread if your post doesn't refer to the current thread.
MichaelAtOz can you do the shift?
To answer your question: If you use the right tools and handle them
properly, curvy things with fancy shapes are well possible in OpenSCAD. See
my sketchy code doing a handle similar to the one you referred to. I used a
technique that leads into the world of point lists where affine operations
are implemented as functions. It comprises an interpolation scheme named
nSpline() from the splines.scad lib, one or more shape generator schemes an
extrusion path scheme which have to be individually implemented and the
extrusion scheme sweep() from the Naca_sweep.scad lib. Follow the link to
download these libraries.
To see what happens you can cautiously play around with the values of A.
Each row of A (and B) is a parameter set that is interpreted by handle() and
describes a key slice and its positioning in 3D. As commented in the line
above A, a slice is defined by two radii used in the oval() call, a rotation
around the y axis, and a translation along x and z. The interpolation scheme
interpolates the key slices sequence into a much more refined sequence.
oval() returns a point list, T_ and Ry_ operate over it, and sweep()
consumes the list with the slices and does all the dirty work needed for
extrusion and the final polyhedron call.
< http://forum.openscad.org/file/t887/handle.png>
use <naca_sweep.scad> // https://www.thingiverse.com/thing:1208001/filesuse <splines.scad> // https://www.thingiverse.com/thing:1208001/files//parameters to be interpolated and interpreted by handle()
// r R rot_y, x, z
A = [
[10, 28, 0, 100, 0],
[ 6, 18, 45, 95, 30],
[8, 8, 90, 70, 40],
[10, 10, 90, 65, 40],
[15, 15, 90, 0, 40],
[10, 10, 90, 65, 40],
[8, 8, 90, 70, 40],
[ 8, 18, 135, 95, 30],
[10, 28, 180, 100, 0],
];
B = nSpline(A, N=100); // interpolation
sweep(handle(B)); // extrusion
function handle(A) = let(N = len(A))
[for(i=[0:N1])
T_(A[i][3], 0, A[i][4], // translate
Ry_(A[i][2], // rotate
oval(r=A[i][0], R=A[i][1])))]; // shape function
function oval(r = 10, R=20, N = 60) =
let(N_ = 2*ceil(N/2), c = circle(r, N=N_), off = (Rr)/2)
[for(j=[0:N_1]) let(o=j<N_/2?off:off) [c[j][0], c[j][1]+o, 0]];
function circle(r=10, N=30) = [for(i=[0:N1]) r*[cos(360/N*i),
sin(360/N*i)]];

Sent from: http://forum.openscad.org/_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


Many things are possible. Some are not easy. :)
There are literally thousands of ways to approach this.
Here is a quick approximation of the curved part of the handle.
$fn=32;
intersection(){
minkowski(){
difference(){
cylinder(d=8,h=3,center=true);
cylinder(d=6,h=10,center=true);
translate([4,0,1.25])rotate([0,10,0])cube([15,15,1],center=true);
translate([4,0,1.25])rotate([0,10,0])cube([15,15,1],center=true);
}
sphere(d=2,center=true,$fn=32);
}
translate([3,0,0])cube([6,12,12],center=true);
}

Sent from: http://forum.openscad.org/_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


shadowwynd,
The model shown is already the result of a union. I would suppose that a
union would've eliminated those lines but for some reason it hasn't. I'll
post some code when I get a chance, but for now, know that each house piece
is a polyhedron, and the house itself is a union of those polyhedrons.
As for the other replies, I have no idea what they're talking about
¯\_(ツ)_/¯

Sent from: http://forum.openscad.org/_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


On 24.11.2018 19:19, mannifold wrote:
OpenSCAD is fundamentally a solid modeller, i.e. models described as
surface meshes. The "wireframe" view shows you the contours of the
resulting polyhedron faces after boolean operations, but before
tesselation of faces into triangles (STL contains only triangles).
Compare OpenSCAD wireframe views of
cube(20);
translate([5,5,0])cube(20);
versus
cube(20);
translate([5,5,0.0001])cube(20);
You will see a similar effect to what you are describing. The difference
is that the top and bottom surfaces are not perfectly flush in the
second example.
I suspect the same happens in your case. Since the roofs are not
parallel to any global axes, there is a numerical uncertainty in the
exact roof angles, as the two houses are computed from different
coordinates. The result is that they have slightly different roof angles
and/or the top roof is slightly offset +Z from the other. This leads to
the same effect as with the cubes above.
Carsten Arnholm
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


mannifold,
nothing is impossible. It mainly depends on how you construct your solid.
With a global union you easily run into numerical problems, so better avoid
it. If start carving out your house from a large cube in a subtractive
fashion (using a large global difference), you won't see such lines, at
least if you further avoid numerical problems by using oversized
subtrahends. See the following code pieces, which are semantically
equivalent.
rotate([10, 0, 0]) cube(20);
rotate([10, 0, 0]) translate([5,5,0])cube(20); // perfectly calculated, but
no match
use global difference with exact subtrahends
rotate([10, 0, 0])
difference ()
{
cube([25, 25, 20]);
translate([20,0,0]) cube([5,5,20]);
translate([0,20,0]) cube([5,5,20]);
}
even this can cause problems, e.g. when the rotation is applied separately
to each primitive.
difference ()
{
rotate([10, 0, 0])
cube([25, 25, 20]);
rotate([10, 0, 0])
translate([20,0,0]) cube([5,5,20]);
rotate([10, 0, 0])
translate([0,20,0]) cube([5,5,20]);
}
all this doesn't happen with oversized subtrahends
difference ()
{
rotate([10, 0, 0])
cube([25, 25, 20]);
rotate([10, 0, 0])
translate([20,1,1]) cube([6,6,22]);
rotate([10, 0, 0])
translate([1,20,1]) cube([6,6,22]);
}

Sent from: http://forum.openscad.org/_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

