OpenSCAD is a surface modeler that pretends to be a solid modeler. The
question is really how aggressively you want it to pretend.
If stitching together volumes from surface patches is desired, then I'm not
sure it should be done with something called 'polyhedron.'
... Non-manifold polyhedra make sense, even for STL export. ...
STL is also surface - rather than space - modeling. And, although the STL
format has its merits, I don't think "it makes sense in STL" is a good
argument for (or against) having a particular behavior in the modeling
software.
--
Sent from: http://forum.openscad.org/
I'm fascinated that it breaks differently based on the position of the object
in space. Also glad it outputs anything at all, even when I am making a 2d
face with a 3d command.
Parkinbot wrote
Peter, you can test your polyhedron for 3D-printability by writing
polyhedron(verts, faces);
cube();
CGAL will give you an error if the polyhedron is non-manifold. It is as
simple as this.
Parkinbot when I do use polyhedron to make a closed 3D object (not just
faces) it does work for 3d printing.
BUT looks like i can't do differences or intersections. (hull still works)
//this just makes the cube - difference or intersection is ignored
difference(){
polyhedron
(points=[p0,p1,p2,p3,p4,p5,p6,p7],faces=[f0,f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11]);
translate([5,5,5])cube(10);}
p0=[0,0,0];//bottom origin 7:30 0'clock
p1=[0,10,0];//bottom 10:30 0'clock
p2=[10,10,0];//bottom 1:30 0'clock
p3=[10,0,0];//bottom 4:30 0'clock
p4=[0,0,10];//top origin 7:30 0'clock
p5=[0,10,10];//top 10:30 0'clock
p6=[10,10,10];//top 1:30 0'clock
p7=[10,0,10];//top 4:30 0'clock
f0=[0,2,1];//bottom1
f1=[0,3,2];//bottom2
f2=[0,1,5];//left1
f3=[0,5,4];//left2
f4=[1,6,5];//away1
f5=[1,2,6];//away2
f6=[2,3,7];//right1
f7=[2,7,6];//right2
f8=[0,4,7];//front1
f9=[0,7,3];//front2
f10=[4,5,6];//top1
f11=[4,6,7];//top2
--
Sent from: http://forum.openscad.org/
peetersm wrote
BUT looks like i can't do differences or intersections. (hull still works)
Hmm, your code produces a watertight object. The Boolean operation passes
CGAL (F6) without any problems. Therefore an STL-export will be
3D-printable.
You might have been mislead by F12 (combined) view, which does not show the
result of Boolean operations as you might expect it. I use F12 only to check
for polyhedron correctness. So: use F5 for preview, F12 for orientation
checks and F6 (plus a dummy Boolean operation) for watertight check and STL
correctness of a polyhedron.
@NateTG
I agree that polyhedron() and polygon() stand out from all other primitives
offered by OpenSCAD. This is because they are meant for user-defined stuff -
and thus they indeed provide functionality that allow more experienced users
to squeeze out a lot more from OpenSCAD not covered by the core concepts. In
my eyes they provide about 50% of the power of OpenSCAD, while the other 50%
are Boolean operations. I wouldn't need more to do my work.
In this forum regularly appear posts that demand a closure of these
primitives as they admittedly open a can of worms and bust the CSG paradigm,
which by the way also all the other 2D-primivites do. The argument is always
that a less experienced user might stumble over this or that and that some
posts could have been avoided, if OpenSCAD had a somehow more watertight
implementation.
Clearly, one could imagine implementations of these primitives that
immediately throw errors in case a non-simple polygon or some non-watertight
or wrongly oriented polyhedron is constructed. While this would severly
break existing code it would also prevent output essential for "learning by
doing" when working with these concepts. I am convinced that such a closure
wouldn't help less experienced users, but rather lead to an even steeper
learning curve. On the other side, it would block more experienced users to
do their stuff.
OpenSCAD is not only used to produce STLs for print. A lot of people,
including me, use it to do fancy animations and other "exotic" stuff, like
visualizing Math. Why should this creative "extra" functionality be blocked?
I am always a friend of warnings, because they give valuable hints. Of
course they have to be taken serious, which is not always the case -
especially by less experienced users, who often don't know which
implications a certain warning has. To face this, a beginners/experienced
user mode switch could be introduced. But wouldn't such a switch trigger
posts from people, who don't know about its existence?
I think this forum is enough means to give help and communicate the ways and
tricks for sailing around the different cliffs of OpenSCAD. Procrusting its
scope, or even boarding it up, won't serve any needs.
--
Sent from: http://forum.openscad.org/
On 2/20/2018 3:53 AM, Parkinbot wrote:
In this forum regularly appear posts that demand a closure of these
primitives as they admittedly open a can of worms and bust the CSG
paradigm, which by the way also all the other 2D-primivites do. The
argument is always that a less experienced user might stumble over
this or that and that some posts could have been avoided, if OpenSCAD
had a somehow more watertight implementation.
[...] On the other side, it would block more experienced users to do
their stuff.
By all means, have primitives that let you build exotic structures.
But "polyhedron" is an English word with a meaning and shouldn't be
abused for structures that are not polyhedra.
On 21. feb. 2018 18:55, Jordan Brown wrote:
By all means, have primitives that let you build exotic structures.
But "polyhedron" is an English word with a meaning and shouldn't be
abused for structures that are not polyhedra.
Exactly my point.
Carsten Arnholm