discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Voxel file format

CL
Chow Loong Jin
Fri, Apr 24, 2015 4:13 AM

On Thu, Apr 23, 2015 at 08:16:08AM -0700, Yvette S. Hirth, CCP, CDP wrote:

hi all,

i'm trying to "cut" threads in openSCAD.  i'm using the threads.scad module
i found on thingiverse, like so:

use <threads.scad>;
...
english_thread(diameter=(632ScrewRadius*2),
threads_per_inch=32,
length=(coverDepth+coverThickness),
internal=true,
$fn=30);

gosh, is it slow!  i played a game of freecell and the progress meter
hasn't budged from "just started".  and now i've finished typing this email
and still no progress.

i put cylinders in the code to check for positioning and depth; once i got
those right, i commented out ONLY the first cylinder and inserted just the
code for the one thread above.  my res time (F6) was 45sec; now it could be
hours.  from one thread - and i have four to gen before slicing.

i'm sure the lack of progress is due to threads.scad creating a bazillion
polygons.  i'm not trying to complain; i'm just trying to get my stuff
printed.

is there any alternative to threads.scad?

Use OpenSCAD 2015.03 and threads.scad from MCAD's dev branch. It's an updated
version of the threads.scad you're using. Uses list comprehension, and sweep()
for generalized extrusion of the threads, and is much faster than the
implementation you're using.

--
Kind regards,
Loong Jin

On Thu, Apr 23, 2015 at 08:16:08AM -0700, Yvette S. Hirth, CCP, CDP wrote: > hi all, > > i'm trying to "cut" threads in openSCAD. i'm using the threads.scad module > i found on thingiverse, like so: > > use <threads.scad>; > ... > english_thread(diameter=(632ScrewRadius*2), > threads_per_inch=32, > length=(coverDepth+coverThickness), > internal=true, > $fn=30); > > gosh, is it *slow*! i played a game of freecell and the progress meter > hasn't budged from "just started". and now i've finished typing this email > and still no progress. > > i put cylinders in the code to check for positioning and depth; once i got > those right, i commented out ONLY the first cylinder and inserted just the > code for the one thread above. my res time (F6) was 45sec; now it could be > hours. from *one* thread - and i have four to gen before slicing. > > i'm sure the lack of progress is due to threads.scad creating a bazillion > polygons. i'm not trying to complain; i'm just trying to get my stuff > printed. > > is there any alternative to threads.scad? Use OpenSCAD 2015.03 and threads.scad from MCAD's dev branch. It's an updated version of the threads.scad you're using. Uses list comprehension, and sweep() for generalized extrusion of the threads, and is much faster than the implementation you're using. -- Kind regards, Loong Jin
CL
Chow Loong Jin
Fri, Apr 24, 2015 4:14 AM

On Fri, Apr 24, 2015 at 12:13:00PM +0800, Chow Loong Jin wrote:

On Thu, Apr 23, 2015 at 08:16:08AM -0700, Yvette S. Hirth, CCP, CDP wrote:

hi all,

i'm trying to "cut" threads in openSCAD.  i'm using the threads.scad module
i found on thingiverse, like so:

use <threads.scad>;
...
english_thread(diameter=(632ScrewRadius*2),
threads_per_inch=32,
length=(coverDepth+coverThickness),
internal=true,
$fn=30);

gosh, is it slow!  i played a game of freecell and the progress meter
hasn't budged from "just started".  and now i've finished typing this email
and still no progress.

i put cylinders in the code to check for positioning and depth; once i got
those right, i commented out ONLY the first cylinder and inserted just the
code for the one thread above.  my res time (F6) was 45sec; now it could be
hours.  from one thread - and i have four to gen before slicing.

i'm sure the lack of progress is due to threads.scad creating a bazillion
polygons.  i'm not trying to complain; i'm just trying to get my stuff
printed.

is there any alternative to threads.scad?

Use OpenSCAD 2015.03 and threads.scad from MCAD's dev branch. It's an updated
version of the threads.scad you're using. Uses list comprehension, and sweep()
for generalized extrusion of the threads, and is much faster than the
implementation you're using.

Oh, it also obeys $fs, $fa and $fn, so you'll have to tweak those values for
higher faceting resolution on small diameters. OpenSCAD's default $fs, $fa and
$fn parameters are unfortunately pretty coarse.

--
Kind regards,
Loong Jin

On Fri, Apr 24, 2015 at 12:13:00PM +0800, Chow Loong Jin wrote: > On Thu, Apr 23, 2015 at 08:16:08AM -0700, Yvette S. Hirth, CCP, CDP wrote: > > hi all, > > > > i'm trying to "cut" threads in openSCAD. i'm using the threads.scad module > > i found on thingiverse, like so: > > > > use <threads.scad>; > > ... > > english_thread(diameter=(632ScrewRadius*2), > > threads_per_inch=32, > > length=(coverDepth+coverThickness), > > internal=true, > > $fn=30); > > > > gosh, is it *slow*! i played a game of freecell and the progress meter > > hasn't budged from "just started". and now i've finished typing this email > > and still no progress. > > > > i put cylinders in the code to check for positioning and depth; once i got > > those right, i commented out ONLY the first cylinder and inserted just the > > code for the one thread above. my res time (F6) was 45sec; now it could be > > hours. from *one* thread - and i have four to gen before slicing. > > > > i'm sure the lack of progress is due to threads.scad creating a bazillion > > polygons. i'm not trying to complain; i'm just trying to get my stuff > > printed. > > > > is there any alternative to threads.scad? > > Use OpenSCAD 2015.03 and threads.scad from MCAD's dev branch. It's an updated > version of the threads.scad you're using. Uses list comprehension, and sweep() > for generalized extrusion of the threads, and is much faster than the > implementation you're using. Oh, it also obeys $fs, $fa and $fn, so you'll have to tweak those values for higher faceting resolution on small diameters. OpenSCAD's default $fs, $fa and $fn parameters are unfortunately pretty coarse. -- Kind regards, Loong Jin
NH
nop head
Fri, Apr 24, 2015 10:17 AM

As OpenSCAD tends to generate a lot of tiny polygons

Really, I thought it just generated the polygons implied by the source code
with $fn, etc. Does it make some extra ones up?

On 24 April 2015 at 03:59, Andrew Plumb andrew@plumb.org wrote:

On Apr 23, 2015, at 10:00 PM, Marius Kintel marius@kintel.net wrote:

On Apr 23, 2015, at 21:00 PM, stonysmith stonysmith@gmail.com wrote:

[...] The polygon
reduction they apply has the effect of smoothing the model a bit too much
for my tastes.  It may well be within the resolution of the printer, but to
me the detail produced looks terrible.

That's good feedback.
Perhaps a much better solution would be for OpenSCAD to perform said
polygon reduction on the original design. As OpenSCAD tends to generate a
lot of tiny polygons, we could probably reduce typical designs
significantly before it having a large visual impact.

CGAL does document some mesh reduction approaches:

http://doc.cgal.org/latest/Surface_mesh_simplification/

Andrew.


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

>As OpenSCAD tends to generate a lot of tiny polygons Really, I thought it just generated the polygons implied by the source code with $fn, etc. Does it make some extra ones up? On 24 April 2015 at 03:59, Andrew Plumb <andrew@plumb.org> wrote: > > On Apr 23, 2015, at 10:00 PM, Marius Kintel <marius@kintel.net> wrote: > > On Apr 23, 2015, at 21:00 PM, stonysmith <stonysmith@gmail.com> wrote: > > [...] The polygon > reduction they apply has the effect of smoothing the model a bit too much > for my tastes. It may well be within the resolution of the printer, but to > me the detail produced looks terrible. > > That's good feedback. > Perhaps a much better solution would be for OpenSCAD to perform said > polygon reduction on the original design. As OpenSCAD tends to generate a > lot of tiny polygons, we could probably reduce typical designs > significantly before it having a large visual impact. > > > CGAL does document some mesh reduction approaches: > > http://doc.cgal.org/latest/Surface_mesh_simplification/ > > Andrew. > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >
MK
Marius Kintel
Fri, Apr 24, 2015 9:30 PM

On Apr 24, 2015, at 06:17 AM, nop head nop.head@gmail.com wrote:

As OpenSCAD tends to generate a lot of tiny polygons

Really, I thought it just generated the polygons implied by the source code with $fn, etc. Does it make some extra ones up?

During CSG operations, tiny polygons tend to be introduced by CGAL, partially due to their infinite precision. Some of these polygons could easily be reduced to nothing by employing a topology-preserving optimization mechanism.

-Marius

On Apr 24, 2015, at 06:17 AM, nop head <nop.head@gmail.com> wrote: > >As OpenSCAD tends to generate a lot of tiny polygons > > Really, I thought it just generated the polygons implied by the source code with $fn, etc. Does it make some extra ones up? > During CSG operations, tiny polygons tend to be introduced by CGAL, partially due to their infinite precision. Some of these polygons could easily be reduced to nothing by employing a topology-preserving optimization mechanism. -Marius