discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

STL without render?

BS
Ben Suter
Wed, Jun 1, 2016 11:30 AM

Is it possible to save an STL file without going through the full render step?

It frustrates me that I can see the surface model using "preview",
but apparently can not simply save this as an STL file?

Background: I am using OpenSCAD to generate surface models of neurons,
because the ability to programmatically define 3D surfaces from a set
of tapered cylinders closely matches the way in which neuronal
geometry is represented when derived from experimental measurements.
My goal is to make an STL file that I can use for 3D printing - I
don't care about lighting, viewpoints, textures, colors. Just the pure
surface model.

Currently the render takes 2.5 hours per neuron, severely limiting my
ability to process many neurons and making me doubt whether it's
feasible for me to assemble a single scene with ~50 neurons (as I had
hoped).

In any case, I'm very happy to have found OpenSCAD and have to say
it's been a great pleasure using it in my processing pipeline. Thank
you, and please keep up the great work!

PS: Currently my scene consists of a few thousand individual cylinders
and spheres, each with its own translation and rotation relative to
the origin. However, each of these segments naturally falls into a
geometrical hierarchy - so alternatively I could represent the scene
as a hierarchy of rotations and translations of each child segment
relative to its parent. Is there reason to believe that the
hierarchical representation (with few root nodes) would render faster?

PPS: Here's the console output after my latest render - note this is
on a 16-core Xeon / Windows 7 64-bit / 72 GB RAM / SSD / GTX 970
machine. Are there any OpenSCAD settings I should modify to make
better use of these resources?

Geometries in cache: 6514
Geometry cache size in bytes: 60051248
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 2 hours, 19 minutes, 58 seconds
Top level object is a 3D object:
Simple: yes
Vertices: 490328
Halfedges: 1703918
Edges: 851959
Halffacets: 730078
Facets: 365039
Volumes: 3
Rendering finished.

Is it possible to save an STL file without going through the full render step? It frustrates me that I can *see* the surface model using "preview", but apparently can not simply save this as an STL file? Background: I am using OpenSCAD to generate surface models of neurons, because the ability to programmatically define 3D surfaces from a set of tapered cylinders closely matches the way in which neuronal geometry is represented when derived from experimental measurements. My goal is to make an STL file that I can use for 3D printing - I don't care about lighting, viewpoints, textures, colors. Just the pure surface model. Currently the render takes 2.5 hours per neuron, severely limiting my ability to process many neurons and making me doubt whether it's feasible for me to assemble a single scene with ~50 neurons (as I had hoped). In any case, I'm very happy to have found OpenSCAD and have to say it's been a great pleasure using it in my processing pipeline. Thank you, and please keep up the great work! PS: Currently my scene consists of a few thousand individual cylinders and spheres, each with its own translation and rotation relative to the origin. However, each of these segments naturally falls into a geometrical hierarchy - so alternatively I could represent the scene as a hierarchy of rotations and translations of each child segment relative to its parent. Is there reason to believe that the hierarchical representation (with few root nodes) would render faster? PPS: Here's the console output after my latest render - note this is on a 16-core Xeon / Windows 7 64-bit / 72 GB RAM / SSD / GTX 970 machine. Are there any OpenSCAD settings I should modify to make better use of these resources? Geometries in cache: 6514 Geometry cache size in bytes: 60051248 CGAL Polyhedrons in cache: 0 CGAL cache size in bytes: 0 Total rendering time: 2 hours, 19 minutes, 58 seconds Top level object is a 3D object: Simple: yes Vertices: 490328 Halfedges: 1703918 Edges: 851959 Halffacets: 730078 Facets: 365039 Volumes: 3 Rendering finished.
NH
nop head
Wed, Jun 1, 2016 11:36 AM

No you can only save an image from the preview. The geometry hasn't been
calculated at the point, just a picture of it using graphic rendering
tricks.

On 1 June 2016 at 12:30, Ben Suter ben.suter@gmail.com wrote:

Is it possible to save an STL file without going through the full render
step?

It frustrates me that I can see the surface model using "preview",
but apparently can not simply save this as an STL file?

Background: I am using OpenSCAD to generate surface models of neurons,
because the ability to programmatically define 3D surfaces from a set
of tapered cylinders closely matches the way in which neuronal
geometry is represented when derived from experimental measurements.
My goal is to make an STL file that I can use for 3D printing - I
don't care about lighting, viewpoints, textures, colors. Just the pure
surface model.

Currently the render takes 2.5 hours per neuron, severely limiting my
ability to process many neurons and making me doubt whether it's
feasible for me to assemble a single scene with ~50 neurons (as I had
hoped).

In any case, I'm very happy to have found OpenSCAD and have to say
it's been a great pleasure using it in my processing pipeline. Thank
you, and please keep up the great work!

PS: Currently my scene consists of a few thousand individual cylinders
and spheres, each with its own translation and rotation relative to
the origin. However, each of these segments naturally falls into a
geometrical hierarchy - so alternatively I could represent the scene
as a hierarchy of rotations and translations of each child segment
relative to its parent. Is there reason to believe that the
hierarchical representation (with few root nodes) would render faster?

PPS: Here's the console output after my latest render - note this is
on a 16-core Xeon / Windows 7 64-bit / 72 GB RAM / SSD / GTX 970
machine. Are there any OpenSCAD settings I should modify to make
better use of these resources?

Geometries in cache: 6514
Geometry cache size in bytes: 60051248
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 2 hours, 19 minutes, 58 seconds
Top level object is a 3D object:
Simple: yes
Vertices: 490328
Halfedges: 1703918
Edges: 851959
Halffacets: 730078
Facets: 365039
Volumes: 3
Rendering finished.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

No you can only save an image from the preview. The geometry hasn't been calculated at the point, just a picture of it using graphic rendering tricks. On 1 June 2016 at 12:30, Ben Suter <ben.suter@gmail.com> wrote: > Is it possible to save an STL file without going through the full render > step? > > It frustrates me that I can *see* the surface model using "preview", > but apparently can not simply save this as an STL file? > > Background: I am using OpenSCAD to generate surface models of neurons, > because the ability to programmatically define 3D surfaces from a set > of tapered cylinders closely matches the way in which neuronal > geometry is represented when derived from experimental measurements. > My goal is to make an STL file that I can use for 3D printing - I > don't care about lighting, viewpoints, textures, colors. Just the pure > surface model. > > Currently the render takes 2.5 hours per neuron, severely limiting my > ability to process many neurons and making me doubt whether it's > feasible for me to assemble a single scene with ~50 neurons (as I had > hoped). > > In any case, I'm very happy to have found OpenSCAD and have to say > it's been a great pleasure using it in my processing pipeline. Thank > you, and please keep up the great work! > > > PS: Currently my scene consists of a few thousand individual cylinders > and spheres, each with its own translation and rotation relative to > the origin. However, each of these segments naturally falls into a > geometrical hierarchy - so alternatively I could represent the scene > as a hierarchy of rotations and translations of each child segment > relative to its parent. Is there reason to believe that the > hierarchical representation (with few root nodes) would render faster? > > PPS: Here's the console output after my latest render - note this is > on a 16-core Xeon / Windows 7 64-bit / 72 GB RAM / SSD / GTX 970 > machine. Are there any OpenSCAD settings I should modify to make > better use of these resources? > > Geometries in cache: 6514 > Geometry cache size in bytes: 60051248 > CGAL Polyhedrons in cache: 0 > CGAL cache size in bytes: 0 > Total rendering time: 2 hours, 19 minutes, 58 seconds > Top level object is a 3D object: > Simple: yes > Vertices: 490328 > Halfedges: 1703918 > Edges: 851959 > Halffacets: 730078 > Facets: 365039 > Volumes: 3 > Rendering finished. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
RW
Rob Ward
Wed, Jun 1, 2016 12:29 PM

I like the idea of modeling cellular activity or constructions. OpenSCAD
lends itself really well to visualizing these things, but
computationally we are still limited compared to the biological
capacity. I think a previous thread discussing narrowing bifurcating
cylinders with smooth transitions, similar to what we could expect going
from arteries to capillaries and back to veins, was running into a
similar exponential growth in the computational challenge. It reminded
me though that as every cell reproduces, it essentially spawns another
two computational units in the nucleus of those new cells (The answer to
the N squared problem?).  The programs in the DNA are applying their
rules in the new environment for each new cell.  I can't see us
surpassing this system too quickly with our silicon models, but I admire
the efforts of people such as Ben who are investigating these areas.
Rob

On 01/06/16 21:30, Ben Suter wrote:

Is it possible to save an STL file without going through the full render step?

It frustrates me that I can see the surface model using "preview",
but apparently can not simply save this as an STL file?

Background: I am using OpenSCAD to generate surface models of neurons,
because the ability to programmatically define 3D surfaces from a set
of tapered cylinders closely matches the way in which neuronal
geometry is represented when derived from experimental measurements.
My goal is to make an STL file that I can use for 3D printing - I
don't care about lighting, viewpoints, textures, colors. Just the pure
surface model.

Currently the render takes 2.5 hours per neuron, severely limiting my
ability to process many neurons and making me doubt whether it's
feasible for me to assemble a single scene with ~50 neurons (as I had
hoped).

In any case, I'm very happy to have found OpenSCAD and have to say
it's been a great pleasure using it in my processing pipeline. Thank
you, and please keep up the great work!

PS: Currently my scene consists of a few thousand individual cylinders
and spheres, each with its own translation and rotation relative to
the origin. However, each of these segments naturally falls into a
geometrical hierarchy - so alternatively I could represent the scene
as a hierarchy of rotations and translations of each child segment
relative to its parent. Is there reason to believe that the
hierarchical representation (with few root nodes) would render faster?

PPS: Here's the console output after my latest render - note this is
on a 16-core Xeon / Windows 7 64-bit / 72 GB RAM / SSD / GTX 970
machine. Are there any OpenSCAD settings I should modify to make
better use of these resources?

Geometries in cache: 6514
Geometry cache size in bytes: 60051248
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 2 hours, 19 minutes, 58 seconds
Top level object is a 3D object:
Simple: yes
Vertices: 490328
Halfedges: 1703918
Edges: 851959
Halffacets: 730078
Facets: 365039
Volumes: 3
Rendering finished.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I like the idea of modeling cellular activity or constructions. OpenSCAD lends itself really well to visualizing these things, but computationally we are still limited compared to the biological capacity. I think a previous thread discussing narrowing bifurcating cylinders with smooth transitions, similar to what we could expect going from arteries to capillaries and back to veins, was running into a similar exponential growth in the computational challenge. It reminded me though that as every cell reproduces, it essentially spawns another two computational units in the nucleus of those new cells (The answer to the N squared problem?). The programs in the DNA are applying their rules in the new environment for each new cell. I can't see us surpassing this system too quickly with our silicon models, but I admire the efforts of people such as Ben who are investigating these areas. Rob On 01/06/16 21:30, Ben Suter wrote: > Is it possible to save an STL file without going through the full render step? > > It frustrates me that I can *see* the surface model using "preview", > but apparently can not simply save this as an STL file? > > Background: I am using OpenSCAD to generate surface models of neurons, > because the ability to programmatically define 3D surfaces from a set > of tapered cylinders closely matches the way in which neuronal > geometry is represented when derived from experimental measurements. > My goal is to make an STL file that I can use for 3D printing - I > don't care about lighting, viewpoints, textures, colors. Just the pure > surface model. > > Currently the render takes 2.5 hours per neuron, severely limiting my > ability to process many neurons and making me doubt whether it's > feasible for me to assemble a single scene with ~50 neurons (as I had > hoped). > > In any case, I'm very happy to have found OpenSCAD and have to say > it's been a great pleasure using it in my processing pipeline. Thank > you, and please keep up the great work! > > > PS: Currently my scene consists of a few thousand individual cylinders > and spheres, each with its own translation and rotation relative to > the origin. However, each of these segments naturally falls into a > geometrical hierarchy - so alternatively I could represent the scene > as a hierarchy of rotations and translations of each child segment > relative to its parent. Is there reason to believe that the > hierarchical representation (with few root nodes) would render faster? > > PPS: Here's the console output after my latest render - note this is > on a 16-core Xeon / Windows 7 64-bit / 72 GB RAM / SSD / GTX 970 > machine. Are there any OpenSCAD settings I should modify to make > better use of these resources? > > Geometries in cache: 6514 > Geometry cache size in bytes: 60051248 > CGAL Polyhedrons in cache: 0 > CGAL cache size in bytes: 0 > Total rendering time: 2 hours, 19 minutes, 58 seconds > Top level object is a 3D object: > Simple: yes > Vertices: 490328 > Halfedges: 1703918 > Edges: 851959 > Halffacets: 730078 > Facets: 365039 > Volumes: 3 > Rendering finished. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
B
bsuter
Wed, Jun 1, 2016 1:27 PM

Thank you both for your feedback and input!

nophead wrote

No you can only save an image from the preview. The geometry hasn't been
calculated at the point, just a picture of it using graphic rendering
tricks.

Aha, so the GPU did all the hard work of tessellating, etc. but we can't
"recapture" that? Interesting how fast the GPU preview works (< 1 sec)
compared to how long the render takes (2.3 hours).

Three questions:

  1. Are there any other tools like OpenSCAD that I could try, that also allow
    declarative description of 3D surfaces using cylinder and sphere primitives
    together with geometric transformations? Maybe tools that use the GPU or
    multiple cores for the "render" step?

  2. I'd very much appreciate any tips or suggestions for alternatives: I
    don't need lighting, color, textures or such, I just want to describe the
    geometry using tapered cylinders and spheres, and then have the software
    convert this to a surface model (e.g. tessellate) suitable for 3D printing
    (e.g. STL, OBJ, VRML).

  3. Sticking with OpenSCAD, is it better to have a "flat" or "hierarchical"
    scene graph?

bsuter wrote

PS: Currently my scene consists of a few thousand individual cylinders
and spheres, each with its own translation and rotation relative to
the origin. However, each of these segments naturally falls into a
geometrical hierarchy - so alternatively I could represent the scene
as a hierarchy of rotations and translations of each child segment
relative to its parent. Is there reason to believe that the
hierarchical representation (with few root nodes) would render faster?

--
View this message in context: http://forum.openscad.org/STL-without-render-tp17503p17506.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Thank you both for your feedback and input! nophead wrote > No you can only save an image from the preview. The geometry hasn't been > calculated at the point, just a picture of it using graphic rendering > tricks. Aha, so the GPU did all the hard work of tessellating, etc. but we can't "recapture" that? Interesting how fast the GPU preview works (< 1 sec) compared to how long the render takes (2.3 hours). Three questions: 1. Are there any other tools like OpenSCAD that I could try, that also allow declarative description of 3D surfaces using cylinder and sphere primitives together with geometric transformations? Maybe tools that use the GPU or multiple cores for the "render" step? 2. I'd very much appreciate any tips or suggestions for alternatives: I don't need lighting, color, textures or such, I just want to describe the geometry using tapered cylinders and spheres, and then have the software convert this to a surface model (e.g. tessellate) suitable for 3D printing (e.g. STL, OBJ, VRML). 3. Sticking with OpenSCAD, is it better to have a "flat" or "hierarchical" scene graph? bsuter wrote >> PS: Currently my scene consists of a few thousand individual cylinders >> and spheres, each with its own translation and rotation relative to >> the origin. However, each of these segments naturally falls into a >> geometrical hierarchy - so alternatively I could represent the scene >> as a hierarchy of rotations and translations of each child segment >> relative to its parent. Is there reason to believe that the >> hierarchical representation (with few root nodes) would render faster? -- View this message in context: http://forum.openscad.org/STL-without-render-tp17503p17506.html Sent from the OpenSCAD mailing list archive at Nabble.com.
BS
Ben Suter
Wed, Jun 1, 2016 1:30 PM

Thank you both for your feedback and input!

<quote author="nophead"> No you can only save an image from the preview. The geometry hasn't been calculated at the point, just a picture of it using graphic rendering tricks. </quote>

Aha, so the GPU did all the hard work of tessellating, etc. but we
can't "recapture" that? Interesting how fast the GPU preview works (<
1 sec) compared to how long the render takes (2.3 hours).

Four questions:

  1. Are there any other tools like OpenSCAD that I could try, that also
    allow declarative description of 3D surfaces using cylinder and sphere
    primitives together with geometric transformations? Maybe tools that
    use the GPU or multiple cores for the "render" step?

  2. I'd very much appreciate any tips or suggestions for alternatives:
    I don't need lighting, color, textures or such, I just want to
    describe the geometry using tapered cylinders and spheres, and then
    have the software convert this to a surface model (e.g. tessellate)
    suitable for 3D printing (e.g. STL, OBJ, VRML).

  3. Sticking with OpenSCAD, is it better to have a "flat" or
    "hierarchical" scene graph?

<quote author="bsuter">

PS: Currently my scene consists of a few thousand individual cylinders
and spheres, each with its own translation and rotation relative to
the origin. However, each of these segments naturally falls into a
geometrical hierarchy - so alternatively I could represent the scene
as a hierarchy of rotations and translations of each child segment
relative to its parent. Is there reason to believe that the
hierarchical representation (with few root nodes) would render faster?

</quote>
  1. I subscribed to this email list, but am not getting replies to this
    thread in my inbox. On the web interface (Nabble) I can see replies,
    but when I post a reply there myself, I get a message indicating that
    my reply "was not yet accepted to the mailing list". Any advice on how
    to improve this?

On Wed, Jun 1, 2016 at 1:30 PM, Ben Suter ben.suter@gmail.com wrote:

Is it possible to save an STL file without going through the full render step?

It frustrates me that I can see the surface model using "preview",
but apparently can not simply save this as an STL file?

Background: I am using OpenSCAD to generate surface models of neurons,
because the ability to programmatically define 3D surfaces from a set
of tapered cylinders closely matches the way in which neuronal
geometry is represented when derived from experimental measurements.
My goal is to make an STL file that I can use for 3D printing - I
don't care about lighting, viewpoints, textures, colors. Just the pure
surface model.

Currently the render takes 2.5 hours per neuron, severely limiting my
ability to process many neurons and making me doubt whether it's
feasible for me to assemble a single scene with ~50 neurons (as I had
hoped).

In any case, I'm very happy to have found OpenSCAD and have to say
it's been a great pleasure using it in my processing pipeline. Thank
you, and please keep up the great work!

PS: Currently my scene consists of a few thousand individual cylinders
and spheres, each with its own translation and rotation relative to
the origin. However, each of these segments naturally falls into a
geometrical hierarchy - so alternatively I could represent the scene
as a hierarchy of rotations and translations of each child segment
relative to its parent. Is there reason to believe that the
hierarchical representation (with few root nodes) would render faster?

PPS: Here's the console output after my latest render - note this is
on a 16-core Xeon / Windows 7 64-bit / 72 GB RAM / SSD / GTX 970
machine. Are there any OpenSCAD settings I should modify to make
better use of these resources?

Geometries in cache: 6514
Geometry cache size in bytes: 60051248
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 2 hours, 19 minutes, 58 seconds
Top level object is a 3D object:
Simple: yes
Vertices: 490328
Halfedges: 1703918
Edges: 851959
Halffacets: 730078
Facets: 365039
Volumes: 3
Rendering finished.

Thank you both for your feedback and input! <quote author="nophead"> No you can only save an image from the preview. The geometry hasn't been calculated at the point, just a picture of it using graphic rendering tricks. </quote> Aha, so the GPU did all the hard work of tessellating, etc. but we can't "recapture" that? Interesting how fast the GPU preview works (< 1 sec) compared to how long the render takes (2.3 hours). Four questions: 1. Are there any other tools like OpenSCAD that I could try, that also allow declarative description of 3D surfaces using cylinder and sphere primitives together with geometric transformations? Maybe tools that use the GPU or multiple cores for the "render" step? 2. I'd very much appreciate any tips or suggestions for alternatives: I don't need lighting, color, textures or such, I just want to describe the geometry using tapered cylinders and spheres, and then have the software convert this to a surface model (e.g. tessellate) suitable for 3D printing (e.g. STL, OBJ, VRML). 3. Sticking with OpenSCAD, is it better to have a "flat" or "hierarchical" scene graph? <quote author="bsuter"> > PS: Currently my scene consists of a few thousand individual cylinders > and spheres, each with its own translation and rotation relative to > the origin. However, each of these segments naturally falls into a > geometrical hierarchy - so alternatively I could represent the scene > as a hierarchy of rotations and translations of each child segment > relative to its parent. Is there reason to believe that the > hierarchical representation (with few root nodes) would render faster? </quote> 4. I subscribed to this email list, but am not getting replies to this thread in my inbox. On the web interface (Nabble) I can see replies, but when I post a reply there myself, I get a message indicating that my reply "was not yet accepted to the mailing list". Any advice on how to improve this? On Wed, Jun 1, 2016 at 1:30 PM, Ben Suter <ben.suter@gmail.com> wrote: > Is it possible to save an STL file without going through the full render step? > > It frustrates me that I can *see* the surface model using "preview", > but apparently can not simply save this as an STL file? > > Background: I am using OpenSCAD to generate surface models of neurons, > because the ability to programmatically define 3D surfaces from a set > of tapered cylinders closely matches the way in which neuronal > geometry is represented when derived from experimental measurements. > My goal is to make an STL file that I can use for 3D printing - I > don't care about lighting, viewpoints, textures, colors. Just the pure > surface model. > > Currently the render takes 2.5 hours per neuron, severely limiting my > ability to process many neurons and making me doubt whether it's > feasible for me to assemble a single scene with ~50 neurons (as I had > hoped). > > In any case, I'm very happy to have found OpenSCAD and have to say > it's been a great pleasure using it in my processing pipeline. Thank > you, and please keep up the great work! > > > PS: Currently my scene consists of a few thousand individual cylinders > and spheres, each with its own translation and rotation relative to > the origin. However, each of these segments naturally falls into a > geometrical hierarchy - so alternatively I could represent the scene > as a hierarchy of rotations and translations of each child segment > relative to its parent. Is there reason to believe that the > hierarchical representation (with few root nodes) would render faster? > > PPS: Here's the console output after my latest render - note this is > on a 16-core Xeon / Windows 7 64-bit / 72 GB RAM / SSD / GTX 970 > machine. Are there any OpenSCAD settings I should modify to make > better use of these resources? > > Geometries in cache: 6514 > Geometry cache size in bytes: 60051248 > CGAL Polyhedrons in cache: 0 > CGAL cache size in bytes: 0 > Total rendering time: 2 hours, 19 minutes, 58 seconds > Top level object is a 3D object: > Simple: yes > Vertices: 490328 > Halfedges: 1703918 > Edges: 851959 > Halffacets: 730078 > Facets: 365039 > Volumes: 3 > Rendering finished.
NH
nop head
Wed, Jun 1, 2016 2:04 PM

I am seeing all your messages twice on the mailing list so they are getting
there. When you post on the forum it always says it has not been accepted
to start with.

The preview works by rendering the primitive objects into the Z buffer and
using that to work out which bits are visible. For example when you union
two objects it just draws them both separately. It never actually works out
a 3D representation of the union, just a 2D picture of what it looks like
from one angle.

When you do F6 CGAL is used to calculate the 3D solids very accurately and
is very slow because it uses rational numbers instead of floating point.

Others maybe able to suggest faster alternatives. It is fast enough for the
designs I do so I haven't looked elsewhere.

On 1 June 2016 at 14:30, Ben Suter ben.suter@gmail.com wrote:

Thank you both for your feedback and input!

<quote author="nophead"> No you can only save an image from the preview. The geometry hasn't been calculated at the point, just a picture of it using graphic rendering tricks. </quote>

Aha, so the GPU did all the hard work of tessellating, etc. but we
can't "recapture" that? Interesting how fast the GPU preview works (<
1 sec) compared to how long the render takes (2.3 hours).

Four questions:

  1. Are there any other tools like OpenSCAD that I could try, that also
    allow declarative description of 3D surfaces using cylinder and sphere
    primitives together with geometric transformations? Maybe tools that
    use the GPU or multiple cores for the "render" step?

  2. I'd very much appreciate any tips or suggestions for alternatives:
    I don't need lighting, color, textures or such, I just want to
    describe the geometry using tapered cylinders and spheres, and then
    have the software convert this to a surface model (e.g. tessellate)
    suitable for 3D printing (e.g. STL, OBJ, VRML).

  3. Sticking with OpenSCAD, is it better to have a "flat" or
    "hierarchical" scene graph?

<quote author="bsuter">

PS: Currently my scene consists of a few thousand individual cylinders
and spheres, each with its own translation and rotation relative to
the origin. However, each of these segments naturally falls into a
geometrical hierarchy - so alternatively I could represent the scene
as a hierarchy of rotations and translations of each child segment
relative to its parent. Is there reason to believe that the
hierarchical representation (with few root nodes) would render faster?

</quote>
  1. I subscribed to this email list, but am not getting replies to this
    thread in my inbox. On the web interface (Nabble) I can see replies,
    but when I post a reply there myself, I get a message indicating that
    my reply "was not yet accepted to the mailing list". Any advice on how
    to improve this?

On Wed, Jun 1, 2016 at 1:30 PM, Ben Suter ben.suter@gmail.com wrote:

Is it possible to save an STL file without going through the full render

step?

It frustrates me that I can see the surface model using "preview",
but apparently can not simply save this as an STL file?

Background: I am using OpenSCAD to generate surface models of neurons,
because the ability to programmatically define 3D surfaces from a set
of tapered cylinders closely matches the way in which neuronal
geometry is represented when derived from experimental measurements.
My goal is to make an STL file that I can use for 3D printing - I
don't care about lighting, viewpoints, textures, colors. Just the pure
surface model.

Currently the render takes 2.5 hours per neuron, severely limiting my
ability to process many neurons and making me doubt whether it's
feasible for me to assemble a single scene with ~50 neurons (as I had
hoped).

In any case, I'm very happy to have found OpenSCAD and have to say
it's been a great pleasure using it in my processing pipeline. Thank
you, and please keep up the great work!

PS: Currently my scene consists of a few thousand individual cylinders
and spheres, each with its own translation and rotation relative to
the origin. However, each of these segments naturally falls into a
geometrical hierarchy - so alternatively I could represent the scene
as a hierarchy of rotations and translations of each child segment
relative to its parent. Is there reason to believe that the
hierarchical representation (with few root nodes) would render faster?

PPS: Here's the console output after my latest render - note this is
on a 16-core Xeon / Windows 7 64-bit / 72 GB RAM / SSD / GTX 970
machine. Are there any OpenSCAD settings I should modify to make
better use of these resources?

Geometries in cache: 6514
Geometry cache size in bytes: 60051248
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 2 hours, 19 minutes, 58 seconds
Top level object is a 3D object:
Simple: yes
Vertices: 490328
Halfedges: 1703918
Edges: 851959
Halffacets: 730078
Facets: 365039
Volumes: 3
Rendering finished.

I am seeing all your messages twice on the mailing list so they are getting there. When you post on the forum it always says it has not been accepted to start with. The preview works by rendering the primitive objects into the Z buffer and using that to work out which bits are visible. For example when you union two objects it just draws them both separately. It never actually works out a 3D representation of the union, just a 2D picture of what it looks like from one angle. When you do F6 CGAL is used to calculate the 3D solids very accurately and is very slow because it uses rational numbers instead of floating point. Others maybe able to suggest faster alternatives. It is fast enough for the designs I do so I haven't looked elsewhere. On 1 June 2016 at 14:30, Ben Suter <ben.suter@gmail.com> wrote: > Thank you both for your feedback and input! > > <quote author="nophead"> > No you can only save an image from the preview. The geometry hasn't been > calculated at the point, just a picture of it using graphic rendering > tricks. > </quote> > > Aha, so the GPU did all the hard work of tessellating, etc. but we > can't "recapture" that? Interesting how fast the GPU preview works (< > 1 sec) compared to how long the render takes (2.3 hours). > > Four questions: > > 1. Are there any other tools like OpenSCAD that I could try, that also > allow declarative description of 3D surfaces using cylinder and sphere > primitives together with geometric transformations? Maybe tools that > use the GPU or multiple cores for the "render" step? > > 2. I'd very much appreciate any tips or suggestions for alternatives: > I don't need lighting, color, textures or such, I just want to > describe the geometry using tapered cylinders and spheres, and then > have the software convert this to a surface model (e.g. tessellate) > suitable for 3D printing (e.g. STL, OBJ, VRML). > > 3. Sticking with OpenSCAD, is it better to have a "flat" or > "hierarchical" scene graph? > <quote author="bsuter"> > > PS: Currently my scene consists of a few thousand individual cylinders > > and spheres, each with its own translation and rotation relative to > > the origin. However, each of these segments naturally falls into a > > geometrical hierarchy - so alternatively I could represent the scene > > as a hierarchy of rotations and translations of each child segment > > relative to its parent. Is there reason to believe that the > > hierarchical representation (with few root nodes) would render faster? > </quote> > > 4. I subscribed to this email list, but am not getting replies to this > thread in my inbox. On the web interface (Nabble) I can see replies, > but when I post a reply there myself, I get a message indicating that > my reply "was not yet accepted to the mailing list". Any advice on how > to improve this? > > > On Wed, Jun 1, 2016 at 1:30 PM, Ben Suter <ben.suter@gmail.com> wrote: > > Is it possible to save an STL file without going through the full render > step? > > > > It frustrates me that I can *see* the surface model using "preview", > > but apparently can not simply save this as an STL file? > > > > Background: I am using OpenSCAD to generate surface models of neurons, > > because the ability to programmatically define 3D surfaces from a set > > of tapered cylinders closely matches the way in which neuronal > > geometry is represented when derived from experimental measurements. > > My goal is to make an STL file that I can use for 3D printing - I > > don't care about lighting, viewpoints, textures, colors. Just the pure > > surface model. > > > > Currently the render takes 2.5 hours per neuron, severely limiting my > > ability to process many neurons and making me doubt whether it's > > feasible for me to assemble a single scene with ~50 neurons (as I had > > hoped). > > > > In any case, I'm very happy to have found OpenSCAD and have to say > > it's been a great pleasure using it in my processing pipeline. Thank > > you, and please keep up the great work! > > > > > > PS: Currently my scene consists of a few thousand individual cylinders > > and spheres, each with its own translation and rotation relative to > > the origin. However, each of these segments naturally falls into a > > geometrical hierarchy - so alternatively I could represent the scene > > as a hierarchy of rotations and translations of each child segment > > relative to its parent. Is there reason to believe that the > > hierarchical representation (with few root nodes) would render faster? > > > > PPS: Here's the console output after my latest render - note this is > > on a 16-core Xeon / Windows 7 64-bit / 72 GB RAM / SSD / GTX 970 > > machine. Are there any OpenSCAD settings I should modify to make > > better use of these resources? > > > > Geometries in cache: 6514 > > Geometry cache size in bytes: 60051248 > > CGAL Polyhedrons in cache: 0 > > CGAL cache size in bytes: 0 > > Total rendering time: 2 hours, 19 minutes, 58 seconds > > Top level object is a 3D object: > > Simple: yes > > Vertices: 490328 > > Halfedges: 1703918 > > Edges: 851959 > > Halffacets: 730078 > > Facets: 365039 > > Volumes: 3 > > Rendering finished. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
P
Parkinbot
Wed, Jun 1, 2016 5:22 PM

Can you share some image that shows your model in detail?

In OpenSCAD there are fast and slow alternatives to produce a design. If you
stack too many primitives on top of each other, use boolean operations over
too much detail (number of vertices) or special high-level operators like
minkowski() and hull(), rendering gets slow. And it gets even slower, when
you try to clone complex shapes into more complex structures like grids.

There are also ways to create complex shapes by doing most of triagulation
work on your own. So it depends much on the programming approach you use and
of course on the complexity of the design itself.

--
View this message in context: http://forum.openscad.org/STL-without-render-tp17503p17510.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Can you share some image that shows your model in detail? In OpenSCAD there are fast and slow alternatives to produce a design. If you stack too many primitives on top of each other, use boolean operations over too much detail (number of vertices) or special high-level operators like minkowski() and hull(), rendering gets slow. And it gets even slower, when you try to clone complex shapes into more complex structures like grids. There are also ways to create complex shapes by doing most of triagulation work on your own. So it depends much on the programming approach you use and of course on the complexity of the design itself. -- View this message in context: http://forum.openscad.org/STL-without-render-tp17503p17510.html Sent from the OpenSCAD mailing list archive at Nabble.com.
CA
Carsten Arnholm
Wed, Jun 1, 2016 7:16 PM

On 01. juni 2016 15:30, Ben Suter wrote:

  1. Are there any other tools like OpenSCAD that I could try, that also
    allow declarative description of 3D surfaces using cylinder and sphere
    primitives together with geometric transformations? Maybe tools that
    use the GPU or multiple cores for the "render" step?

You could try http://arnholm.org/angelscript-csg-ide/

Be warned that the current public version relies on OpenSCAD to do the
booleans, so you don't gain anything in speed that way.

I do have an unreleased test version that does not use OpenSCAD for
booleans and that is much faster. But it isn't released at this time.

Carsten Arnholm

On 01. juni 2016 15:30, Ben Suter wrote: > 1. Are there any other tools like OpenSCAD that I could try, that also > allow declarative description of 3D surfaces using cylinder and sphere > primitives together with geometric transformations? Maybe tools that > use the GPU or multiple cores for the "render" step? You could try http://arnholm.org/angelscript-csg-ide/ Be warned that the current public version relies on OpenSCAD to do the booleans, so you don't gain anything in speed that way. I do have an unreleased test version that does not use OpenSCAD for booleans and that is much faster. But it isn't released at this time. Carsten Arnholm
B
bsuter
Thu, Jun 2, 2016 10:15 AM

Parkinbot wrote

Can you share some image that shows your model in detail?

Sure, I'm attaching a view here.

CA3pyr-Amaral-c11571.png
http://forum.openscad.org/file/n17523/CA3pyr-Amaral-c11571.png

Parkinbot wrote

In OpenSCAD there are fast and slow alternatives to produce a design. If
you stack too many primitives on top of each other, use boolean operations
over too much detail (number of vertices) or special high-level operators
like minkowski() and hull(), rendering gets slow. And it gets even slower,
when you try to clone complex shapes into more complex structures like
grids.

My model currently consists of a single sphere at the origin, and then about
1600 instances of a (tapered) cylinder with a sphere at the end (I add these
spheres where two non-parallel cylinders come together, to "fill out" the
join between them). I naively implemented each of these cylinder-sphere
pairs like this:

translate([-2.918, -7.452, 0.698])
rotate(93.4419, [0.800474,-0.596353,0])
cylinder($fn=20, 0.499704, 0.8, 0.5);
translate([-3.216, -7.852, 0.668])
sphere($fn=20, 0.5);

So the above 5 lines repeat roughly 1600 times, of course with different
values. The $fn values I chose basically to balance speed and beauty ...

As you can see in the image, this model is a naturally branched structure -
so for many of these cylinder-sphere segments, their translation and
rotation could naturally be defined as relative to their parent segment,
rather than using a flat structure with each segment oriented relative to
the origin (as I do now). Would you expect one of these approaches to be
faster?

Parkinbot wrote

There are also ways to create complex shapes by doing most of triagulation
work on your own. So it depends much on the programming approach you use
and of course on the complexity of the design itself.

Interesting. Could you point me to some more info on the pre-triangulated
approach? I think I can maybe use Matlab (where I am analyzing the geometry
and generating the .scad now) to generate tessellated coordinates for each
cylinder, or at least the vertices.

Thank you very much!

--
View this message in context: http://forum.openscad.org/STL-without-render-tp17503p17523.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Parkinbot wrote > Can you share some image that shows your model in detail? Sure, I'm attaching a view here. CA3pyr-Amaral-c11571.png <http://forum.openscad.org/file/n17523/CA3pyr-Amaral-c11571.png> Parkinbot wrote > In OpenSCAD there are fast and slow alternatives to produce a design. If > you stack too many primitives on top of each other, use boolean operations > over too much detail (number of vertices) or special high-level operators > like minkowski() and hull(), rendering gets slow. And it gets even slower, > when you try to clone complex shapes into more complex structures like > grids. My model currently consists of a single sphere at the origin, and then about 1600 instances of a (tapered) cylinder with a sphere at the end (I add these spheres where two non-parallel cylinders come together, to "fill out" the join between them). I naively implemented each of these cylinder-sphere pairs like this: translate([-2.918, -7.452, 0.698]) rotate(93.4419, [0.800474,-0.596353,0]) cylinder($fn=20, 0.499704, 0.8, 0.5); translate([-3.216, -7.852, 0.668]) sphere($fn=20, 0.5); So the above 5 lines repeat roughly 1600 times, of course with different values. The $fn values I chose basically to balance speed and beauty ... As you can see in the image, this model is a naturally branched structure - so for many of these cylinder-sphere segments, their translation and rotation could naturally be defined as relative to their parent segment, rather than using a flat structure with each segment oriented relative to the origin (as I do now). Would you expect one of these approaches to be faster? Parkinbot wrote > There are also ways to create complex shapes by doing most of triagulation > work on your own. So it depends much on the programming approach you use > and of course on the complexity of the design itself. Interesting. Could you point me to some more info on the pre-triangulated approach? I think I can maybe use Matlab (where I am analyzing the geometry and generating the .scad now) to generate tessellated coordinates for each cylinder, or at least the vertices. Thank you very much! -- View this message in context: http://forum.openscad.org/STL-without-render-tp17503p17523.html Sent from the OpenSCAD mailing list archive at Nabble.com.
P
Parkinbot
Thu, Jun 2, 2016 11:24 AM

How lovely! Nice to see, what people do with OpenSCAD.

A similar problem, doing a union() of a large number of cylinder and sphere
primitives is currently discussed here.
http://www.thingiverse.com/groups/openscad/topic:6515#comment-900694
CGAL rendering is not very efficient when (very) large numbers of shapes
come into play.

I've implemented some Matlab class to generically describe arteries with an
interpolation scheme. The output is a winding 'wire' in 3D with free radius
a each point in STL-format. In lack of an own union or furcation operator
capable to do the intersection triangulation we currently use OpenSCAD and
Blender to compose porperly placed wires into tree structures which we again
cut into puzzle pieces for 3D print.

You might be interested for inspiration or even build on at least part of
the code (in a non-commercial way), e.g. to implement this 'little' details
on your own. Send me a PM to get in further touch.

I imagine some tree class, allowing for a (recursive) generic description of
path points with radii that can render its objects to STL. In your case, I
guess, you will add a net class to connect those tree objects formally into
a network to do functional simulation.
OpenSCAD or any other CAD-Programm could be used to provide the final
union() operation connecting some number of precompiled trees (neurons) into
a printable unit. I wouldn't advise to do the programming natively in
OpenSCAD.

Rudolf

--
View this message in context: http://forum.openscad.org/STL-without-render-tp17503p17524.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

How lovely! Nice to see, what people do with OpenSCAD. A similar problem, doing a union() of a large number of cylinder and sphere primitives is currently discussed here. http://www.thingiverse.com/groups/openscad/topic:6515#comment-900694 CGAL rendering is not very efficient when (very) large numbers of shapes come into play. I've implemented some Matlab class to generically describe arteries with an interpolation scheme. The output is a winding 'wire' in 3D with free radius a each point in STL-format. In lack of an own union or furcation operator capable to do the intersection triangulation we currently use OpenSCAD and Blender to compose porperly placed wires into tree structures which we again cut into puzzle pieces for 3D print. You might be interested for inspiration or even build on at least part of the code (in a non-commercial way), e.g. to implement this 'little' details on your own. Send me a PM to get in further touch. I imagine some tree class, allowing for a (recursive) generic description of path points with radii that can render its objects to STL. In your case, I guess, you will add a net class to connect those tree objects formally into a network to do functional simulation. OpenSCAD or any other CAD-Programm could be used to provide the final union() operation connecting some number of precompiled trees (neurons) into a printable unit. I wouldn't advise to do the programming natively in OpenSCAD. Rudolf -- View this message in context: http://forum.openscad.org/STL-without-render-tp17503p17524.html Sent from the OpenSCAD mailing list archive at Nabble.com.