[OpenSCAD] Improve rendering speed

Ronaldo rcmpersiano at gmail.com
Fri Jun 10 12:56:22 EDT 2016

Parkinbot wrote
> this looks good and shows that your Frep-stuff is working well, besides
> that it could profit from some (implicit) grid refining scheme near the
> borders.

Yes, the borders are a lot rough. I did not implemented any feature
detection scheme. They are a lot harder to implement. A local refining
scheme would improve the edges but they would be rough anyway.

> Ok, you use the triple cosine shortcut instead of the minimal surface
> calculation, but this is another theme. 
> To be able to print it, one would also like to have a skin extruded
> structure, which was the point where my effort (and time) ended. 

I used the approximation I found in Wikipedia. I am not acquainted to the
minimal surface theory and have not found any exact implicit form of the

By changing the code a little and redefining the Schwartz primitive, I got
the following:
The upper image represents just the surface and it is not a manyfold. It was
obtained by commenting 4 lines of the f_mesh_evaluation code eliminating the
six bounding box of the mesh.

The lower image seems to be what you wanted. The Schwartz primitive for that
was simply redefined as:

> function Schwartz_p(pt, a,b,c,d) =
>     let( s = a*cos(pt[0]) + b*cos(pt[1]) + c*cos(pt[2]) )
>     min( s, - s + d);

So, the inside surface was obtained just by doing an "offset" of the
original function value and the min() is equivalent to an intersection. That
is one of the marvelous things of the implicit representation of f-reps.

This last run took a longer time to preview: 20min. So, I think we are in
the wrong thread to discuss this subject :)

> BTW, I used an ordinary R²->R function plot after resolving the implict
> equation to z and discretrizing it over a domain restricted to the partial
> symmetry. While this gives you a nice border around the top hole, you can
> use union operations to repeat the rendered chuck for all symmetries with
> the required orientation.

I have no idea of what you are saying here. But I tip my hat to you.

@jon, I could not say it better.

View this message in context: http://forum.openscad.org/Improve-rendering-speed-tp17580p17636.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

More information about the Discuss mailing list