Hi,
I have a polygon.
I make an offset and translate the copy of the polygon, than I make a hull
for both.
hull() {
polygon(paths = [[0, 1, 2, 3]], points = [[0, -0.2250000000], [0,
0.7350000000], [0.9000000000, 0.5250000000], [0.9000000000,
-0.1350000000]]);
translate(v = [0, 0, 0.1000000000]) {
offset(r = 0.1000000000) {
polygon(paths = [[0, 1, 2, 3]], points = [[0, -0.2250000000],
[0, 0.7350000000], [0.9000000000, 0.5250000000], [0.9000000000,
-0.1350000000]]);
}
}
}
It is rendered into a simple 2d, offsetted and translated polygon.
http://forum.openscad.org/file/n20968/Screenshot_2017-03-21_02-01-35.png
Preview is also interesting. It is like the offsetted polygon is extruded.
http://forum.openscad.org/file/n20968/Screenshot_2017-03-21_02-03-32.png
I wouldn't expect these results.
--
View this message in context: http://forum.openscad.org/Is-this-render-correct-tp20968.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
You are right, it is odd. There is nothing wrong with your code. The render
of polygons is the correct answer to your code. In preview, OpenSCAD have
the vice of representing polygons extruded by one unit. But it is just a
representation; polygons still have no volume.
BTW, you don't so much zeros to represent numbers. Internally they are
double floats.
It is also better to use larger numbers, ATM OpenSCAD can have issues at such
small dimensions.
Work 10x or 100x larger, then if needed scale down the end result.
Admin - PM me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
View this message in context: http://forum.openscad.org/Is-this-render-correct-tp20968p20970.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Thanks for the hints!
Sorry for the many zeros in my code, it is SolidPython generated.
I have tried to do it with an about 100 times upscale, but I stiil don't get
the result what I expect.
I have removed the offset() from the code to make it even simpler:
hull() {
polygon(paths = [[0, 1, 2, 3]], points = [[0, -22.50000000], [0,
73.50000000], [90.00000000, 52.50000000], [90.00000000, -13.50000000]]);
translate(v = [0, 0, 100.00000000]) {
polygon(paths = [[0, 1, 2, 3]], points = [[0, -22.50000000], [0,
73.50000000], [90.00000000, 52.50000000], [90.00000000, -13.50000000]]);
}
}
The result is, both in preview and render, simply the 2d base polygon. For
this I'd expect a 3d solid object, which would be identical with the base
polygon, extruded along the z axis.
I have tried to achieved the same with linear_extrude():
linear_extrude(height=100) {
polygon(paths = [[0, 1, 2, 3]], points = [[0, -22.50000000], [0,
73.50000000], [90.00000000, 52.50000000], [90.00000000, -13.50000000]]);
}
It is working.
Can it be that the hull() function doesn't work with Z translated 2d
polygons?
--
View this message in context: http://forum.openscad.org/Is-this-render-correct-tp20968p20977.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
hull() is working if I create thin solids from the polygons:
hull() {
linear_extrude(height=5) {
polygon(paths = [[0, 1, 2, 3]], points = [[0, -22.50000000], [0,
73.50000000], [90.00000000, 52.50000000], [90.00000000, -13.50000000]]);
}
translate(v = [0, 0, 100.00000000]) {
linear_extrude(height=5) {
offset(r=10) {
polygon(paths = [[0, 1, 2, 3]], points = [[0, -22.50000000],
[0, 73.50000000], [90.00000000, 52.50000000], [90.00000000, -13.50000000]]);
}
}
}
}
--
View this message in context: http://forum.openscad.org/Is-this-render-correct-tp20968p20978.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Hull can work on 2D shapes or on 3D shapes. It doesn't work on a mixture of
both or a 2D shape with a Z offset. In fact you should never apply Z
offsets to 2D objects. Think of them living in a flat 2D world. Extrude is
needed to bring them into the 3D world.
OpenSCAD should ignore Z for 2D objects but it actually does inconsistent
things with it.
On 21 March 2017 at 10:51, Endre ebak32@gmail.com wrote:
hull() is working if I create thin solids from the polygons:
hull() {
linear_extrude(height=5) {
polygon(paths = [[0, 1, 2, 3]], points = [[0, -22.50000000], [0,
73.50000000], [90.00000000, 52.50000000], [90.00000000, -13.50000000]]);
}
translate(v = [0, 0, 100.00000000]) {
linear_extrude(height=5) {
offset(r=10) {
polygon(paths = [[0, 1, 2, 3]], points = [[0,
-22.50000000],
[0, 73.50000000], [90.00000000, 52.50000000], [90.00000000,
-13.50000000]]);
}
}
}
}
--
View this message in context: http://forum.openscad.org/Is-
this-render-correct-tp20968p20978.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