[OpenSCAD] Evaluating imported STL's

Parkinbot rudolf at parkinbot.com
Wed Jun 15 19:45:51 EDT 2016

This is one of the typical pathological cases, not worth discussing much in
programming context. You are both right, mathematically an empty set used as
operand for Minkowski will "eat up" any other operand. 

But in programming an operator is better defined and implemented to be as
robust as possible.

It is easy to "prove", that there is no [0,0,0] involved, otherwise the
following code would not evaluate to a cube. 

> hull()
> {
>   translate([10, 0])
>   cube(5); 
>   difference() // nothing
>   {
>     sphere(1);
>     sphere(2);
>   }
> }

OpenSCAD implements Minkowski as I would expect it, and do it myself. 

I would want

> minkowski(){}

not to throw an error. And

> minkowski(){
> cube[a,b,c]; 
> }; 

to have cube[a,b,c] as unchanged result, instead of getting a not-defined
error. Same applies for intersection(), union() and so on. 

Second, I would not want any shape evaluating to empty to eat up everthing.

> minkowski(){
> A();
> B();
> C();
> ...
> }

Imagine C() is not defined (missing library) and a warning is issued. Should
the result then be empty? For what? For mathematical correctness? 

View this message in context: http://forum.openscad.org/Evaluating-imported-STL-s-tp17682p17702.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

More information about the Discuss mailing list