Why doesn't OpenSCAD include these features:
A) Points as a primitive geometric figure
B) A convex hull operation (not minkowski sum)
These would come in handy for doing things like constructing a simplex or a
skewed pyramid
--
Sent from: http://forum.openscad.org/
Convex hull is called "hull".
To construct a skewed pyramid or tetrahedron (3D simplex) from points, use "polyhedron".
On Sat, Oct 3, 2020, at 7:56 PM, nate_lastname wrote:
Why doesn't OpenSCAD include these features:
A) Points as a primitive geometric figure
B) A convex hull operation (not minkowski sum)
These would come in handy for doing things like constructing a simplex or a
skewed pyramid
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Convex hull is called "hull".
I see. Still, I wonder why points are not a primitive shape in OpenScad.
To construct a skewed pyramid or tetrahedron (3D simplex) from points, use
"polyhedron".
The problem with the polyhedron command is that it is hard to use since it
depends on the order in which the points are passed. Maybe it works that way
because OpenSCAD loads the points directly into an OpenGL vertex buffer.
Converting the vertices of a convex solid to something that OpenGL can
render is a nontrivial problem. (am I correct?)
In general, I suspect that it would be more elegant to do a lot of things if
it were possible to specify a point in OpenSCAD. I'm really just curious if
this is a deliberate design choice or not. Theoretically, would it be
possible to add points to OpenSCAD?
--
Sent from: http://forum.openscad.org/
This should work:
module hull_points(pts) {
hull() { polyhedron(pts, [[for(i=[0:len(pts)-1]) i]]); }
}
hull_points( [ [-1,-1,0], [-1,1,0], [1,1,0], [1,-1,0], [1/2,1,2] ] );
Em dom., 4 de out. de 2020 às 03:46, nate_lastname <
nathannichols454@gmail.com> escreveu:
Convex hull is called "hull".
I see. Still, I wonder why points are not a primitive shape in OpenScad.
To construct a skewed pyramid or tetrahedron (3D simplex) from points,
use
"polyhedron".
The problem with the polyhedron command is that it is hard to use since it
depends on the order in which the points are passed. Maybe it works that
way
because OpenSCAD loads the points directly into an OpenGL vertex buffer.
Converting the vertices of a convex solid to something that OpenGL can
render is a nontrivial problem. (am I correct?)
In general, I suspect that it would be more elegant to do a lot of things
if
it were possible to specify a point in OpenSCAD. I'm really just curious if
this is a deliberate design choice or not. Theoretically, would it be
possible to add points to OpenSCAD?
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I see. Still, I wonder why points are not a primitive shape in OpenScad.
What's the shape of a point? In math, a point has a definite position, but
it does not have any length, breadth or thickness.
If you want a mark denotes the existence of a point, you can define your own
one. For example, a circle denotes a 2D point.
module point2D(x, y, r = 1) {
translate([x, y])
circle(r);
}
point2D(10, 20);
Sent from: http://forum.openscad.org/
On 10/3/2020 9:33 PM, caterpillar wrote:
What's the shape of a point? In math, a point has a definite position,
but it does not have any length, breadth or thickness.
Sure it does. It has a length, breadth, and thickness of zero.
It's a lot like sphere(0.00000001), but even smaller. But you could
probably use that or cube(0.0000001) as an approximation to a point.
caterpillar wrote
What's the shape of a point? In math, a point has a definite position, but
it does not have any length, breadth or thickness.
Well, a point (and, for that matter, a line) doesn't have any volume, but it
does have a position. It may not be that useful in itself, but it (or a
line) can be a very useful tool in creating other objects.
OpenSCAD has 2D objects, they don't have a volume, but are very useful for
creating 3D objects.
Also, remember that not all OpenSCAD users use it for 3D printing. I use it
for so diverse uses as furniture design, laser cutting, board game designs
and so on. I use 2D objects a lot (for laser cutting, it's all 2D, though
sometimes extruded to see fit of boxes and so on), and I would definitely
find both line (and related objects, such as curves) and point very useful.
Sure, I can do a line as a very thin box, but then the laser cutter will run
the line twice, as there is actually two lines, and it'll overburn the ends
slightly.
--
Sent from: http://forum.openscad.org/
It's a lot like sphere(0.00000001), but even smaller. But you could
probably use that or cube(0.0000001) as an approximation to a point.
If you just want an approximation to a point with a customizable shape, this
might solve it.
$fn = 96;
module point(x = 0, y = 0, z = 0) {
translate([x, y, z])
children();
}
point(10, 20)
circle(0.000001);
point(10, 20, 30)
sphere(0.000001);
Sent from: http://forum.openscad.org/
Sure, I can do a line as a very thin box, but then the laser cutter will
run
the line twice, as there is actually two lines, and it'll overburn the ends
slightly.
Sorry, I don't know laser cutting. Maybe I'm wrong, it sounds like a path (a
list of points) supported by laser cutting, not a shape.
Sent from: http://forum.openscad.org/
module hull_points(pts) {
hull() { polyhedron(pts, [[for(i=[0:len(pts)-1]) i]]); }
}
hull_points( [ [-1,-1,0], [-1,1,0], [1,1,0], [1,-1,0], [1/2,1,2] ] );
It looks like a nice workaround.
My 2D version:
use <experimental/convex_hull.scad>; //
https://github.com/JustinSDK/dotSCAD/blob/master/src/experimental/convex_hull.scad
module hull_points2D(pts) {
hull() { polygon(convex_hull(pts)); }
}
hull_points2D([[0, 0], [0, 1], [1, 0], [3, 0]]);
Sent from: http://forum.openscad.org/