discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

reduction of computing time - ideas?

RW
Raymond West
Mon, Jan 6, 2025 12:49 PM

I've done some comparisons for time taken to manifold render between
calculations using my rounding over method compared to Minkowski. The
results are listed below,  rounding first, Minkowski  second

  calculate(s=5,knob=60,fil=6,thick=15);              3.8secs     8.3secs

  calculate(s=5,knob=60,fil=10,thick=20);            6.0secs        9.6secs

  calculate(s=12,knob=60,fil=6,thick=15);            8.5secs    11.2secs

  calculate(s=27,knob=100,fil=11,thick=24);       27secs 29secs

The rounding 'steps' are 0,1mm, which do not show when sliced/printed.
Higher resolution is easy to set, but it will take longer to render.
Another advantage, is that the rounding profile can be adjusted, to
allow a steeper start for the bottom edge, eliminating supports, for
example. However, I think Minkowski may be a better option, if it is
intended to scale the stl file, or produce it by something other than by
fdm printing.

On 06/01/2025 01:03, Raymond West via Discuss wrote:

There is a formula, but a bit tricky, as I said, a number of triangles
involved. The 2d line drawing I posted a few days ago gave an
indication of the construction of the basic shape. I completed it for
the simple case, where the scallop diameter equals the diameter of the
'blobs' lying between them.

There are only four parameters required for the basic shape, for
example - calculate(s=5,knob=48,fil=6,thick=15)  (s is number of
scallops, knob is overall diameter, fil is radius of fillet (top and
bottom), thick is total thickness.) It works fine now, from one
scallop up to whatever. (I argued with myself wrt one scallop, whether
or not it should produce  no knob, but I settled on a simple circular
one - if the scallop size was smaller, then there would be no argument
🙂).

The more scallops, or the larger the knob, the slower the Minkowski. I
modified my bevel script, to do round-overs, I think that would be
quicker, than Minkowski, but would depend on the radius of the
round-overs. (The above values for 'calculate' takes less than ten
seconds to calculate using manifold, and 25 seconds for 25 scallops,
both using Minkowski.)

 If there are different radii for the scallops compared to the
'blobs', then the triangles between the centres are no longer
equilateral, but Isosceles, which makes the calculations a bit
different, but not much more so,  I've not bothered with that,
although it would be the generic formula, it would introduce a couple
more more parameters, unnecessary choices when none need to made if
all we are concerned with are generic scalloped knobs for fdm printing.

On 05/01/2025 21:45, Thomas Richter via Discuss wrote:

Hi all,

I wish you all a good start into the new year.

I took a few days off and worked on it only sporadically but today I
finished the analytical solution (almost - see problem description
below). The base body can be created in the current state of the
software. The object in the images attached here renders in about 500
milliseconds.

It can be found here:
https://github.com/trses/screw-nut-knobs/blob/webapp-proto/analytical-solution.scad

@Raymond: I am convinced that there is not one (rather simple
trigonometric) formula that can generate the shape, but two for the
two different arcs. You also have to determine the points of contact
of the two arcs. It can of course probably be solved with a
Taylor-like approximation but I didn't want to go that way.

This afternoon I realised that I'm almost done building a general
solution to make any polyhedron out of an arbitrary list of layers of
points. They points of one layer can even have different z values. I
might go those few final steps sometimes but at next I will build the
web application to generate the knobs.

If anyone has the nerve to look at this, I'd be interested in
suggestions on how the features of OpenSCAD could be better utilised.
I have a very software engineering heavy approach to tackling these
things.

Additionally, I realized a strange problem: when setting the number
of arms (variable ARMS) to 13 or 17 the following error occurs:

WARNING: PolySet -> Manifold conversion failed: NotManifold
Trying to repair and reconstruct mesh..
ERROR: [manifold] Input mesh is not closed!
ERROR: [manifold] Surface_mesh -> Manifold conversion failed:
NotManifold

There are a couple more value combinations where this happens but
there seems to be no general rule. For larger numbers of arms like -
e. g. - 20 it works again. If you comment out the subtraction of the
hollow sphere in line 147 it renders without problems (but looks
strange though ;-)). I have checked the polyhedron several times by
hand, it is generated correctly.

OpenSCAD seems to have a glitch with boolean operations on more
sophisticated shapes, possibly especially when there seem to be very
small resulting faces.

It would be nice if someone had an idea about this. I could easily
extend the body and generate additional layers for the surface to
omit the subtraction at all but I'd like to understand what's the cause.

Thanks again for your support.

Am 26.12.2024 um 20:06 schrieb Adrian Mariano via Discuss
discuss@lists.openscad.org:

Ray, are you saying it's only the upside-down rounded edges that you
think are "awful"?  I don't really understand.  I basically round
every edge I possibly can in my models---but that doesn't include
upside-down ones.   I'll have to look into that adaptive layer
thickness.

On Thu, Dec 26, 2024 at 2:00 PM Raymond West via Discuss
discuss@lists.openscad.org wrote:

On 26/12/2024 15:03, Adrian Mariano via Discuss wrote:

I'm not sure what Ray has against rounded edges.  I use them all
the time and think they look and feel great in my FDM printed models.

What does NOT look great in my experience is something like the
gradual dome top of the knob, which tends to have a very exposed
layer line step-structure with very wide and visible steps that I
think look and feel pretty bad.  That will be worse the closer you
are to flat---I don't know how bad it would look with the model as
shown.  I printed a knob to go on my audio amp and my first version
had a domed top like shown and I scratched that and went back to
flat after I felt the model in hand.

The other thing that does NOT look great is a roundover printed
upside down.

Hi Adrian, you half answered your own question to me, and nop head
gave  the top half answer,  wrt adaptive.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I've done some comparisons for time taken to manifold render between calculations using my rounding over method compared to Minkowski. The results are listed below,  rounding first, Minkowski  second   calculate(s=5,knob=60,fil=6,thick=15);              3.8secs     8.3secs   calculate(s=5,knob=60,fil=10,thick=20);            6.0secs        9.6secs   calculate(s=12,knob=60,fil=6,thick=15);            8.5secs    11.2secs   calculate(s=27,knob=100,fil=11,thick=24);       27secs 29secs The rounding 'steps' are 0,1mm, which do not show when sliced/printed. Higher resolution is easy to set, but it will take longer to render. Another advantage, is that the rounding profile can be adjusted, to allow a steeper start for the bottom edge, eliminating supports, for example. However, I think Minkowski may be a better option, if it is intended to scale the stl file, or produce it by something other than by fdm printing. On 06/01/2025 01:03, Raymond West via Discuss wrote: > There is a formula, but a bit tricky, as I said, a number of triangles > involved. The 2d line drawing I posted a few days ago gave an > indication of the construction of the basic shape. I completed it for > the simple case, where the scallop diameter equals the diameter of the > 'blobs' lying between them. > > There are only four parameters required for the basic shape, for > example - calculate(s=5,knob=48,fil=6,thick=15)  (s is number of > scallops, knob is overall diameter, fil is radius of fillet (top and > bottom), thick is total thickness.) It works fine now, from one > scallop up to whatever. (I argued with myself wrt one scallop, whether > or not it should produce  no knob, but I settled on a simple circular > one - if the scallop size was smaller, then there would be no argument > 🙂). > > The more scallops, or the larger the knob, the slower the Minkowski. I > modified my bevel script, to do round-overs, I think that would be > quicker, than Minkowski, but would depend on the radius of the > round-overs. (The above values for 'calculate' takes less than ten > seconds to calculate using manifold, and 25 seconds for 25 scallops, > both using Minkowski.) > >  If there are different radii for the scallops compared to the > 'blobs', then the triangles between the centres are no longer > equilateral, but Isosceles, which makes the calculations a bit > different, but not much more so,  I've not bothered with that, > although it would be the generic formula, it would introduce a couple > more more parameters, unnecessary choices when none need to made if > all we are concerned with are generic scalloped knobs for fdm printing. > > On 05/01/2025 21:45, Thomas Richter via Discuss wrote: >> Hi all, >> >> I wish you all a good start into the new year. >> >> I took a few days off and worked on it only sporadically but today I >> finished the analytical solution (almost - see problem description >> below). The base body can be created in the current state of the >> software. The object in the images attached here renders in about 500 >> milliseconds. >> >> It can be found here: >> https://github.com/trses/screw-nut-knobs/blob/webapp-proto/analytical-solution.scad >> >> @Raymond: I am convinced that there is not one (rather simple >> trigonometric) formula that can generate the shape, but two for the >> two different arcs. You also have to determine the points of contact >> of the two arcs. It can of course probably be solved with a >> Taylor-like approximation but I didn't want to go that way. >> >> This afternoon I realised that I'm almost done building a general >> solution to make any polyhedron out of an arbitrary list of layers of >> points. They points of one layer can even have different z values. I >> might go those few final steps sometimes but at next I will build the >> web application to generate the knobs. >> >> If anyone has the nerve to look at this, I'd be interested in >> suggestions on how the features of OpenSCAD could be better utilised. >> I have a very software engineering heavy approach to tackling these >> things. >> >> Additionally, I realized a strange problem: when setting the number >> of arms (variable ARMS) to 13 or 17 the following error occurs: >> >> WARNING: PolySet -> Manifold conversion failed: NotManifold >> Trying to repair and reconstruct mesh.. >> ERROR: [manifold] Input mesh is not closed! >> ERROR: [manifold] Surface_mesh -> Manifold conversion failed: >> NotManifold >> >> There are a couple more value combinations where this happens but >> there seems to be no general rule. For larger numbers of arms like - >> e. g. - 20 it works again. If you comment out the subtraction of the >> hollow sphere in line 147 it renders without problems (but looks >> strange though ;-)). I have checked the polyhedron several times by >> hand, it is generated correctly. >> >> OpenSCAD seems to have a glitch with boolean operations on more >> sophisticated shapes, possibly especially when there seem to be very >> small resulting faces. >> >> It would be nice if someone had an idea about this. I could easily >> extend the body and generate additional layers for the surface to >> omit the subtraction at all but I'd like to understand what's the cause. >> >> Thanks again for your support. >> >>> Am 26.12.2024 um 20:06 schrieb Adrian Mariano via Discuss >>> <discuss@lists.openscad.org>: >>> >>> Ray, are you saying it's only the upside-down rounded edges that you >>> think are "awful"?  I don't really understand.  I basically round >>> every edge I possibly can in my models---but that doesn't include >>> upside-down ones.   I'll have to look into that adaptive layer >>> thickness. >>> >>> On Thu, Dec 26, 2024 at 2:00 PM Raymond West via Discuss >>> <discuss@lists.openscad.org> wrote: >>> >>> On 26/12/2024 15:03, Adrian Mariano via Discuss wrote: >>>> I'm not sure what Ray has against rounded edges.  I use them all >>>> the time and think they look and feel great in my FDM printed models. >>>> >>>> What does NOT look great in my experience is something like the >>>> gradual dome top of the knob, which tends to have a very exposed >>>> layer line step-structure with very wide and visible steps that I >>>> think look and feel pretty bad.  That will be worse the closer you >>>> are to flat---I don't know how bad it would look with the model as >>>> shown.  I printed a knob to go on my audio amp and my first version >>>> had a domed top like shown and I scratched that and went back to >>>> flat after I felt the model in hand. >>>> >>>> The other thing that does NOT look great is a roundover printed >>>> upside down. >>>> >>> Hi Adrian, you half answered your own question to me, and nop head >>> gave  the top half answer,  wrt adaptive. >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org