Discussion:
slow render, need help
(too old to reply)
Michael Brown
2011-10-24 05:36:15 UTC
Permalink
I am trying out openscad to make a few things, and I've run up against a
brick wall in that my designs are previewing, but wont render or stl export
in a 'reasonable' time. I'm using latest openscad git updated yesterday on a
Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.

I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V, (
http://www.thingiverse.com/thing:7361 and
http://www.thingiverse.com/thing:8928). I'm trying to make a container using
the bracelet design as the sides and spiro coaster design for the lid. I
merged the scad programs, and basically rewrote a lot of it, so it's more
'inspired' by at this point, but it all previews nicely and looks good. My
problem at this point is that it is taking *forever* to compile, and using
almost 2GB of ram. I'm trying to figure out why it is taking so long.

I've uploaded my code to github (
https://github.com/superchalupa/container-round-decorative). Attached is the
main module I've developed.

For comparison, I've re-compiled MakeALot's bracelet and it compiles in
about 41 minutes for me. When I redid the same basic bracelet design with my
code, it literally took 23 hours. The object is fairly simple, so I am at a
loss as to why it takes so long. It is a torus with about 100 oval holes. At
first I was specifying $fn variables, but under the assumption that I was
over-specifying things, I've removed almost all of those. The second thing I
did was that I was using unit circles and scaling, which ends up using only
5 fragments, so I started using larger circles and different scaling factors
to let openscad choose a more appropriate number of fragments. This has not
seemed to help.

Calling my main module with this:

// for my 3 year old (small)
radius=23;
bracelet_width=35;
wall_thick=3;
hole_len=8;
distance_between_holes=1;
hole_rotation_angle = 80;
num_divisions_around = 16;
edge_buffer=2;

holy_squished_hollow_torus(bracelet_width,
radius,
wall_thick,
edge_buffer,
hole_len,
distance_between_holes,
hole_rotation_angle,
num_divisions_around);


Results in this:

time make bracelet.stl
openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename bracelet.stl
.stl)\"
Compiling library
`/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
Compiling library
`/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
ECHO: "y_step: ", 8.863269777109872
ECHO: "num big ovals: ", 3
ECHO: "degrees_per_y", 0.4392519091611444
ECHO: "leftover", 11
CGAL Cache insert: group(); (0 verts)
Number of polygons before reduction: 1
... cut ...

CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
CGAL Cache insert: difference(){group(){difference(){group( (26991 verts)
CGAL Cache insert: group(){group();group();group();group(); (26991 verts)
CGAL Cache insert: group(){group(){group();group();group(); (26991 verts)

real 1415m34.047s
user 1404m59.223s
sys 0m10.050s

--
Michael
Don Bright
2011-10-24 22:00:03 UTC
Permalink
Sorry, I can't find pins.scad


On Mon, Oct 24, 2011 at 12:36 AM, Michael Brown
<***@michaels-house.net> wrote:
> I am trying out openscad to make a few things, and I've run up against a
> brick wall in that my designs are previewing, but wont render or stl export
> in a 'reasonable' time. I'm using latest openscad git updated yesterday on a
> Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.
> I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V,
> (http://www.thingiverse.com/thing:7361
> and http://www.thingiverse.com/thing:8928). I'm trying to make a container
> using the bracelet design as the sides and spiro coaster design for the
> lid. I merged the scad programs, and basically rewrote a lot of it, so it's
> more 'inspired' by at this point, but it all previews nicely and looks good.
> My problem at this point is that it is taking *forever* to compile, and
> using almost 2GB of ram. I'm trying to figure out why it is taking so long.
>  I've uploaded my code to github
> (https://github.com/superchalupa/container-round-decorative). Attached is
> the main module I've developed.
> For comparison, I've re-compiled MakeALot's bracelet and it compiles in
> about 41 minutes for me. When I redid the same basic bracelet design with my
> code, it literally took 23 hours. The object is fairly simple, so I am at a
> loss as to why it takes so long. It is a torus with about 100 oval holes. At
> first I was specifying $fn variables, but under the assumption that I was
> over-specifying things, I've removed almost all of those. The second thing I
> did was that I was using unit circles and scaling, which ends up using only
> 5 fragments, so I started using larger circles and different scaling factors
> to let openscad choose a more appropriate number of fragments. This has not
> seemed to help.
> Calling my main module with this:
>
> // for my 3 year old (small)
> radius=23;
> bracelet_width=35;
> wall_thick=3;
> hole_len=8;
> distance_between_holes=1;
> hole_rotation_angle = 80;
> num_divisions_around = 16;
> edge_buffer=2;
> holy_squished_hollow_torus(bracelet_width,
>                            radius,
>                            wall_thick,
>                            edge_buffer,
>                            hole_len,
>                            distance_between_holes,
>                            hole_rotation_angle,
>                            num_divisions_around);
>
> Results in this:
> time make bracelet.stl
> openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename bracelet.stl
> .stl)\"
> Compiling library
> `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
> Compiling library
> `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
> ECHO: "y_step: ", 8.863269777109872
> ECHO: "num big ovals: ", 3
> ECHO: "degrees_per_y", 0.4392519091611444
> ECHO: "leftover", 11
> CGAL Cache insert: group(); (0 verts)
> Number of polygons before reduction: 1
>     ... cut ...
> CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
> CGAL Cache insert: difference(){group(){difference(){group( (26991 verts)
> CGAL Cache insert: group(){group();group();group();group(); (26991 verts)
> CGAL Cache insert: group(){group(){group();group();group(); (26991 verts)
> real 1415m34.047s
> user 1404m59.223s
> sys 0m10.050s
> --
> Michael
>
>
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
>
Don Bright
2011-10-24 22:05:03 UTC
Permalink
nevermind. i see it requires a script.
however the script doesn't work under mingw nor does it work under cygwin


On Mon, Oct 24, 2011 at 5:00 PM, Don Bright <***@gmail.com> wrote:
> Sorry, I can't find pins.scad
>
>
> On Mon, Oct 24, 2011 at 12:36 AM, Michael Brown
> <***@michaels-house.net> wrote:
>> I am trying out openscad to make a few things, and I've run up against a
>> brick wall in that my designs are previewing, but wont render or stl export
>> in a 'reasonable' time. I'm using latest openscad git updated yesterday on a
>> Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.
>> I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V,
>> (http://www.thingiverse.com/thing:7361
>> and http://www.thingiverse.com/thing:8928). I'm trying to make a container
>> using the bracelet design as the sides and spiro coaster design for the
>> lid. I merged the scad programs, and basically rewrote a lot of it, so it's
>> more 'inspired' by at this point, but it all previews nicely and looks good.
>> My problem at this point is that it is taking *forever* to compile, and
>> using almost 2GB of ram. I'm trying to figure out why it is taking so long.
>>  I've uploaded my code to github
>> (https://github.com/superchalupa/container-round-decorative). Attached is
>> the main module I've developed.
>> For comparison, I've re-compiled MakeALot's bracelet and it compiles in
>> about 41 minutes for me. When I redid the same basic bracelet design with my
>> code, it literally took 23 hours. The object is fairly simple, so I am at a
>> loss as to why it takes so long. It is a torus with about 100 oval holes. At
>> first I was specifying $fn variables, but under the assumption that I was
>> over-specifying things, I've removed almost all of those. The second thing I
>> did was that I was using unit circles and scaling, which ends up using only
>> 5 fragments, so I started using larger circles and different scaling factors
>> to let openscad choose a more appropriate number of fragments. This has not
>> seemed to help.
>> Calling my main module with this:
>>
>> // for my 3 year old (small)
>> radius=23;
>> bracelet_width=35;
>> wall_thick=3;
>> hole_len=8;
>> distance_between_holes=1;
>> hole_rotation_angle = 80;
>> num_divisions_around = 16;
>> edge_buffer=2;
>> holy_squished_hollow_torus(bracelet_width,
>>                            radius,
>>                            wall_thick,
>>                            edge_buffer,
>>                            hole_len,
>>                            distance_between_holes,
>>                            hole_rotation_angle,
>>                            num_divisions_around);
>>
>> Results in this:
>> time make bracelet.stl
>> openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename bracelet.stl
>> .stl)\"
>> Compiling library
>> `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
>> Compiling library
>> `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
>> ECHO: "y_step: ", 8.863269777109872
>> ECHO: "num big ovals: ", 3
>> ECHO: "degrees_per_y", 0.4392519091611444
>> ECHO: "leftover", 11
>> CGAL Cache insert: group(); (0 verts)
>> Number of polygons before reduction: 1
>>     ... cut ...
>> CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
>> CGAL Cache insert: difference(){group(){difference(){group( (26991 verts)
>> CGAL Cache insert: group(){group();group();group();group(); (26991 verts)
>> CGAL Cache insert: group(){group(){group();group();group(); (26991 verts)
>> real 1415m34.047s
>> user 1404m59.223s
>> sys 0m10.050s
>> --
>> Michael
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> ***@rocklinux.org
>> http://rocklinux.net/mailman/listinfo/openscad
>>
>>
>
Brad Pitcher
2011-10-24 22:50:58 UTC
Permalink
I get an assertion error when I make using tip:

openscad -o lid.stl box.scad -Dlayout=\"$(basename lid.stl .stl)\"
Compiling library
`/media/code/container-round-decorative/container_module.scad'.
Compiling library `/media/code/container-round-decorative/pins.scad'.
ECHO: "Running build for layout", "lid"
CGAL Cache insert: group(); (0 verts)
Number of polygons before reduction: 1

Number of polygons after reduction: 1

CGAL Cache insert: circle($fn=0,$fa=1.27324,$fs=1,r=40); (130 verts)
Number of polygons before reduction: 124

Number of polygons after reduction: 1

CGAL Cache insert: multmatrix([[0.125,0,0,0],[0,0.875,0,0], (130 verts)
Number of polygons before reduction: 124

Number of polygons after reduction: 1

CGAL Cache insert: multmatrix([[1,0,0,40],[0,1,0,0],[0,0,1, (130 verts)
CGAL Cache insert: rotate_extrude(convexity=2,$fn=0,$fa=1.2 (17892 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,3 (17892 verts)
CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (17892 verts)
Number of polygons before reduction: 1

Number of polygons after reduction: 1

CGAL Cache insert: circle($fn=0,$fa=1.33246,$fs=1,r=40); (130 verts)
Number of polygons before reduction: 124

Number of polygons after reduction: 1

CGAL Cache insert: multmatrix([[0.075,0,0,0],[0,0.85,0,0],[ (130 verts)
Number of polygons before reduction: 124

Number of polygons after reduction: 1

CGAL Cache insert: multmatrix([[1,0,0,40],[0,1,0,0],[0,0,1, (130 verts)
CGAL Cache insert: rotate_extrude(convexity=2,$fn=0,$fa=1.3 (17136 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,3 (17136 verts)
CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (17136 verts)
CGAL Cache insert: difference(){group(){multmatrix([[1,0,0, (35300 verts)
CGAL Cache insert: group(){difference(){group(){multmatrix( (35300 verts)
CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=70.2,r1=40 (60 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,- (60 verts)
CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=70,r1=50,r (60 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,3 (60 verts)
CGAL Cache insert: difference(){group(){difference(){group( (3756 verts)
CGAL Cache insert: cube(size=[5,10,7.5],center=false); (8 verts)
CGAL Cache insert: multmatrix([[1,0,0,-44],[0,1,0,-5],[0,0, (8 verts)
Number of polygons before reduction: 1

Number of polygons after reduction: 1

CGAL Cache insert: circle($fn=0,$fa=1.27324,$fs=1,r=40); (130 verts)
Number of polygons before reduction: 124

Number of polygons after reduction: 1

CGAL Cache insert: multmatrix([[0.125,0,0,0],[0,0.875,0,0], (130 verts)
Number of polygons before reduction: 124

Number of polygons after reduction: 1

CGAL Cache insert: multmatrix([[1,0,0,40],[0,1,0,0],[0,0,1, (130 verts)
CGAL Cache insert: rotate_extrude(convexity=2,$fn=0,$fa=1.2 (17892 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,3 (17892 verts)
CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (17892 verts)
CGAL Cache insert: difference(){multmatrix([[1,0,0,-44],[0, (196 verts)
CGAL Cache insert: cube(size=[2,10,1],center=false); (8 verts)
CGAL Cache insert: multmatrix([[1,0,0,-1],[0,1,0,-5],[0,0,1 (8 verts)
CGAL Cache insert: multmatrix([[0.707107,0,0.707107,0],[0,1 (8 verts)
CGAL Cache insert: multmatrix([[1,0,0,-42.75],[0,1,0,0],[0, (8 verts)
CGAL Cache insert: multmatrix([[0.707107,0,-0.707107,0],[0, (8 verts)
CGAL Cache insert: multmatrix([[1,0,0,-42.75],[0,1,0,0],[0, (8 verts)
CGAL Cache insert: multmatrix([[1,0,0,-44],[0,1,0,-5],[0,0, (8 verts)
CGAL Cache insert: group(){difference(){multmatrix([[1,0,0, (200 verts)
CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=4,r1=4,r2= (26 verts)
CGAL Cache insert: multmatrix([[1,0,0,38],[0,1,0,0],[0,0,1, (26 verts)
CGAL Cache insert: cylinder($fn=30,$fa=12,$fs=1,h=7,r1=4,r2 (60 verts)
CGAL Cache insert: cylinder($fn=30,$fa=12,$fs=1,h=0.75,r1=4 (60 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,7 (60 verts)
CGAL Cache insert: cylinder($fn=30,$fa=12,$fs=1,h=0.75,r1=4 (60 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,7 (60 verts)
CGAL Cache insert: cylinder($fn=30,$fa=12,$fs=1,h=1.5,r1=4. (60 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,8 (60 verts)
CGAL Cache insert: union(){cylinder($fn=30,$fa=12,$fs=1,h=7 (150 verts)
CGAL Cache insert: group(){union(){cylinder($fn=30,$fa=12,$ (150 verts)
CGAL Cache insert: cube(size=[2,10,10],center=false); (8 verts)
CGAL Cache insert: multmatrix([[1,0,0,-1],[0,1,0,-5],[0,0,1 (8 verts)
CGAL Cache insert: cylinder($fn=20,$fa=12,$fs=1,h=13,r1=1.6 (40 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,2 (40 verts)
CGAL Cache insert: cube(size=[16,2,12],center=false); (8 verts)
CGAL Cache insert: multmatrix([[1,0,0,-8],[0,1,0,-5.5],[0,0 (8 verts)
CGAL Cache insert: multmatrix([[1,0,0,-8],[0,1,0,3.5],[0,0, (8 verts)
CGAL Cache insert: difference(){group(){union(){cylinder($f (186 verts)
CGAL Cache insert: group(){difference(){group(){union(){cyl (186 verts)
CGAL Cache insert: group(){group(){difference(){group(){uni (186 verts)
CGAL Cache insert: group(){group(){group(){difference(){gro (186 verts)
CGAL Cache insert: multmatrix([[1,0,0,38],[0,1,0,0],[0,0,1, (186 verts)
CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=3,r1=41,r2 (60 verts)
CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=3.2,r1=39. (60 verts)
CGAL Cache insert: difference(){cylinder($fn=0,$fa=12,$fs=1 (120 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,1 (120 verts)
CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (120 verts)
CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=3,r1=20.5, (60 verts)
CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=3.2,r1=19, (60 verts)
CGAL Cache insert: difference(){cylinder($fn=0,$fa=12,$fs=1 (120 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,1 (120 verts)
CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (120 verts)
CGAL Cache insert: multmatrix([[1,0,0,20.5],[0,1,0,0],[0,0, (120 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,0 (120 verts)
CGAL Cache insert: multmatrix([[0.951057,-0.309017,0,0],[0. (120 verts)
CGAL Cache insert: multmatrix([[0.809017,-0.587785,0,0],[0. (120 verts)
CGAL Cache insert: multmatrix([[0.587785,-0.809017,0,0],[0. (120 verts)
CGAL Cache insert: multmatrix([[0.309017,-0.951057,0,0],[0. (120 verts)
CGAL Cache insert: multmatrix([[2.22045e-16,-1,0,0],[1,1.77 (120 verts)
CGAL Cache insert: multmatrix([[-0.309017,-0.951057,0,0],[0 (120 verts)
CGAL Cache insert: multmatrix([[-0.587785,-0.809017,0,0],[0 (120 verts)
CGAL Cache insert: multmatrix([[-0.809017,-0.587785,0,0],[0 (120 verts)
CGAL Cache insert: multmatrix([[-0.951057,-0.309017,0,0],[0 (120 verts)
CGAL Cache insert: multmatrix([[-1,-1.22461e-16,0,0],[1.224 (120 verts)
CGAL Cache insert: multmatrix([[-0.951057,0.309017,0,0],[-0 (120 verts)
CGAL Cache insert: multmatrix([[-0.809017,0.587785,0,0],[-0 (120 verts)
CGAL Cache insert: multmatrix([[-0.587785,0.809017,0,0],[-0 (120 verts)
CGAL Cache insert: multmatrix([[-0.309017,0.951057,0,0],[-0 (120 verts)
CGAL Cache insert: multmatrix([[-2.22045e-16,1,0,0],[-1,-1. (120 verts)
CGAL Cache insert: multmatrix([[0.309017,0.951057,0,0],[-0. (120 verts)
CGAL Cache insert: multmatrix([[0.587785,0.809017,0,0],[-0. (120 verts)
CGAL Cache insert: multmatrix([[0.809017,0.587785,0,0],[-0. (120 verts)
CGAL Cache insert: multmatrix([[0.951057,0.309017,0,0],[-0. (120 verts)
CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (2800 verts)
CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (2800 verts)
CGAL Cache insert: cube(size=[2,1,1],center=false); (8 verts)
CGAL Cache insert: multmatrix([[1,0,0,-1],[0,1,0,39],[0,0,1 (8 verts)
CGAL Cache insert: multmatrix([[1,0,0,-1],[0,1,0,-40],[0,0, (8 verts)
CGAL Cache insert: group(){multmatrix([[1,0,0,-1],[0,1,0,39 (16 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,3 (16 verts)
CGAL Cache insert: union(){difference(){group(){difference( (5670 verts)
CGAL Cache insert: group(){union(){difference(){group(){dif (5670 verts)
CGAL Cache insert: group(){group(){union(){difference(){gro (5670 verts)
openscad: src/CGALEvaluator.cc:86: CGAL_Nef_polyhedron
CGALEvaluator::applyToChildren(const AbstractNode&, CGALEvaluator::CsgOp):
Assertion `isCached(*chnode)' failed.
Aborted
make: *** [lid.stl] Error 134


On Mon, Oct 24, 2011 at 3:05 PM, Don Bright <***@gmail.com> wrote:

> nevermind. i see it requires a script.
> however the script doesn't work under mingw nor does it work under cygwin
>
>
> On Mon, Oct 24, 2011 at 5:00 PM, Don Bright <***@gmail.com>
> wrote:
> > Sorry, I can't find pins.scad
> >
> >
> > On Mon, Oct 24, 2011 at 12:36 AM, Michael Brown
> > <***@michaels-house.net> wrote:
> >> I am trying out openscad to make a few things, and I've run up against a
> >> brick wall in that my designs are previewing, but wont render or stl
> export
> >> in a 'reasonable' time. I'm using latest openscad git updated yesterday
> on a
> >> Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.
> >> I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V,
> >> (http://www.thingiverse.com/thing:7361
> >> and http://www.thingiverse.com/thing:8928). I'm trying to make a
> container
> >> using the bracelet design as the sides and spiro coaster design for the
> >> lid. I merged the scad programs, and basically rewrote a lot of it, so
> it's
> >> more 'inspired' by at this point, but it all previews nicely and looks
> good.
> >> My problem at this point is that it is taking *forever* to compile, and
> >> using almost 2GB of ram. I'm trying to figure out why it is taking so
> long.
> >> I've uploaded my code to github
> >> (https://github.com/superchalupa/container-round-decorative). Attached
> is
> >> the main module I've developed.
> >> For comparison, I've re-compiled MakeALot's bracelet and it compiles in
> >> about 41 minutes for me. When I redid the same basic bracelet design
> with my
> >> code, it literally took 23 hours. The object is fairly simple, so I am
> at a
> >> loss as to why it takes so long. It is a torus with about 100 oval
> holes. At
> >> first I was specifying $fn variables, but under the assumption that I
> was
> >> over-specifying things, I've removed almost all of those. The second
> thing I
> >> did was that I was using unit circles and scaling, which ends up using
> only
> >> 5 fragments, so I started using larger circles and different scaling
> factors
> >> to let openscad choose a more appropriate number of fragments. This has
> not
> >> seemed to help.
> >> Calling my main module with this:
> >>
> >> // for my 3 year old (small)
> >> radius=23;
> >> bracelet_width=35;
> >> wall_thick=3;
> >> hole_len=8;
> >> distance_between_holes=1;
> >> hole_rotation_angle = 80;
> >> num_divisions_around = 16;
> >> edge_buffer=2;
> >> holy_squished_hollow_torus(bracelet_width,
> >> radius,
> >> wall_thick,
> >> edge_buffer,
> >> hole_len,
> >> distance_between_holes,
> >> hole_rotation_angle,
> >> num_divisions_around);
> >>
> >> Results in this:
> >> time make bracelet.stl
> >> openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename
> bracelet.stl
> >> .stl)\"
> >> Compiling library
> >>
> `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
> >> Compiling library
> >> `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
> >> ECHO: "y_step: ", 8.863269777109872
> >> ECHO: "num big ovals: ", 3
> >> ECHO: "degrees_per_y", 0.4392519091611444
> >> ECHO: "leftover", 11
> >> CGAL Cache insert: group(); (0 verts)
> >> Number of polygons before reduction: 1
> >> ... cut ...
> >> CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
> >> CGAL Cache insert: difference(){group(){difference(){group( (26991
> verts)
> >> CGAL Cache insert: group(){group();group();group();group(); (26991
> verts)
> >> CGAL Cache insert: group(){group(){group();group();group(); (26991
> verts)
> >> real 1415m34.047s
> >> user 1404m59.223s
> >> sys 0m10.050s
> >> --
> >> Michael
> >>
> >>
> >> _______________________________________________
> >> OpenSCAD mailing list
> >> ***@rocklinux.org
> >> http://rocklinux.net/mailman/listinfo/openscad
> >>
> >>
> >
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
Michael Brown
2011-10-24 23:17:43 UTC
Permalink
I'm getting the same assertion now. :(

But at least its only taking an hour to give it.
--
Michael

On Mon, Oct 24, 2011 at 5:50 PM, Brad Pitcher <***@gmail.com> wrote:

> I get an assertion error when I make using tip:
>
> openscad -o lid.stl box.scad -Dlayout=\"$(basename lid.stl .stl)\"
> Compiling library
> `/media/code/container-round-decorative/container_module.scad'.
> Compiling library `/media/code/container-round-decorative/pins.scad'.
> ECHO: "Running build for layout", "lid"
> CGAL Cache insert: group(); (0 verts)
> Number of polygons before reduction: 1
>
> Number of polygons after reduction: 1
>
> CGAL Cache insert: circle($fn=0,$fa=1.27324,$fs=1,r=40); (130 verts)
> Number of polygons before reduction: 124
>
> Number of polygons after reduction: 1
>
> CGAL Cache insert: multmatrix([[0.125,0,0,0],[0,0.875,0,0], (130 verts)
> Number of polygons before reduction: 124
>
> Number of polygons after reduction: 1
>
> CGAL Cache insert: multmatrix([[1,0,0,40],[0,1,0,0],[0,0,1, (130 verts)
> CGAL Cache insert: rotate_extrude(convexity=2,$fn=0,$fa=1.2 (17892 verts)
> CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,3 (17892 verts)
> CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (17892 verts)
> Number of polygons before reduction: 1
>
> Number of polygons after reduction: 1
>
> CGAL Cache insert: circle($fn=0,$fa=1.33246,$fs=1,r=40); (130 verts)
> Number of polygons before reduction: 124
>
> Number of polygons after reduction: 1
>
> CGAL Cache insert: multmatrix([[0.075,0,0,0],[0,0.85,0,0],[ (130 verts)
> Number of polygons before reduction: 124
>
> Number of polygons after reduction: 1
>
> CGAL Cache insert: multmatrix([[1,0,0,40],[0,1,0,0],[0,0,1, (130 verts)
> CGAL Cache insert: rotate_extrude(convexity=2,$fn=0,$fa=1.3 (17136 verts)
> CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,3 (17136 verts)
> CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (17136 verts)
> CGAL Cache insert: difference(){group(){multmatrix([[1,0,0, (35300 verts)
> CGAL Cache insert: group(){difference(){group(){multmatrix( (35300 verts)
> CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=70.2,r1=40 (60 verts)
> CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,- (60 verts)
> CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=70,r1=50,r (60 verts)
> CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,3 (60 verts)
> CGAL Cache insert: difference(){group(){difference(){group( (3756 verts)
> CGAL Cache insert: cube(size=[5,10,7.5],center=false); (8 verts)
> CGAL Cache insert: multmatrix([[1,0,0,-44],[0,1,0,-5],[0,0, (8 verts)
> Number of polygons before reduction: 1
>
> Number of polygons after reduction: 1
>
> CGAL Cache insert: circle($fn=0,$fa=1.27324,$fs=1,r=40); (130 verts)
> Number of polygons before reduction: 124
>
> Number of polygons after reduction: 1
>
> CGAL Cache insert: multmatrix([[0.125,0,0,0],[0,0.875,0,0], (130 verts)
> Number of polygons before reduction: 124
>
> Number of polygons after reduction: 1
>
> CGAL Cache insert: multmatrix([[1,0,0,40],[0,1,0,0],[0,0,1, (130 verts)
> CGAL Cache insert: rotate_extrude(convexity=2,$fn=0,$fa=1.2 (17892 verts)
> CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,3 (17892 verts)
> CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (17892 verts)
> CGAL Cache insert: difference(){multmatrix([[1,0,0,-44],[0, (196 verts)
> CGAL Cache insert: cube(size=[2,10,1],center=false); (8 verts)
> CGAL Cache insert: multmatrix([[1,0,0,-1],[0,1,0,-5],[0,0,1 (8 verts)
> CGAL Cache insert: multmatrix([[0.707107,0,0.707107,0],[0,1 (8 verts)
> CGAL Cache insert: multmatrix([[1,0,0,-42.75],[0,1,0,0],[0, (8 verts)
> CGAL Cache insert: multmatrix([[0.707107,0,-0.707107,0],[0, (8 verts)
> CGAL Cache insert: multmatrix([[1,0,0,-42.75],[0,1,0,0],[0, (8 verts)
> CGAL Cache insert: multmatrix([[1,0,0,-44],[0,1,0,-5],[0,0, (8 verts)
> CGAL Cache insert: group(){difference(){multmatrix([[1,0,0, (200 verts)
> CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=4,r1=4,r2= (26 verts)
> CGAL Cache insert: multmatrix([[1,0,0,38],[0,1,0,0],[0,0,1, (26 verts)
> CGAL Cache insert: cylinder($fn=30,$fa=12,$fs=1,h=7,r1=4,r2 (60 verts)
> CGAL Cache insert: cylinder($fn=30,$fa=12,$fs=1,h=0.75,r1=4 (60 verts)
> CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,7 (60 verts)
> CGAL Cache insert: cylinder($fn=30,$fa=12,$fs=1,h=0.75,r1=4 (60 verts)
> CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,7 (60 verts)
> CGAL Cache insert: cylinder($fn=30,$fa=12,$fs=1,h=1.5,r1=4. (60 verts)
> CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,8 (60 verts)
> CGAL Cache insert: union(){cylinder($fn=30,$fa=12,$fs=1,h=7 (150 verts)
> CGAL Cache insert: group(){union(){cylinder($fn=30,$fa=12,$ (150 verts)
> CGAL Cache insert: cube(size=[2,10,10],center=false); (8 verts)
> CGAL Cache insert: multmatrix([[1,0,0,-1],[0,1,0,-5],[0,0,1 (8 verts)
> CGAL Cache insert: cylinder($fn=20,$fa=12,$fs=1,h=13,r1=1.6 (40 verts)
> CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,2 (40 verts)
> CGAL Cache insert: cube(size=[16,2,12],center=false); (8 verts)
> CGAL Cache insert: multmatrix([[1,0,0,-8],[0,1,0,-5.5],[0,0 (8 verts)
> CGAL Cache insert: multmatrix([[1,0,0,-8],[0,1,0,3.5],[0,0, (8 verts)
> CGAL Cache insert: difference(){group(){union(){cylinder($f (186 verts)
> CGAL Cache insert: group(){difference(){group(){union(){cyl (186 verts)
> CGAL Cache insert: group(){group(){difference(){group(){uni (186 verts)
> CGAL Cache insert: group(){group(){group(){difference(){gro (186 verts)
> CGAL Cache insert: multmatrix([[1,0,0,38],[0,1,0,0],[0,0,1, (186 verts)
> CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=3,r1=41,r2 (60 verts)
> CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=3.2,r1=39. (60 verts)
> CGAL Cache insert: difference(){cylinder($fn=0,$fa=12,$fs=1 (120 verts)
> CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,1 (120 verts)
> CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (120 verts)
> CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=3,r1=20.5, (60 verts)
> CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=3.2,r1=19, (60 verts)
> CGAL Cache insert: difference(){cylinder($fn=0,$fa=12,$fs=1 (120 verts)
> CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,1 (120 verts)
> CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (120 verts)
> CGAL Cache insert: multmatrix([[1,0,0,20.5],[0,1,0,0],[0,0, (120 verts)
> CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,0 (120 verts)
> CGAL Cache insert: multmatrix([[0.951057,-0.309017,0,0],[0. (120 verts)
> CGAL Cache insert: multmatrix([[0.809017,-0.587785,0,0],[0. (120 verts)
> CGAL Cache insert: multmatrix([[0.587785,-0.809017,0,0],[0. (120 verts)
> CGAL Cache insert: multmatrix([[0.309017,-0.951057,0,0],[0. (120 verts)
> CGAL Cache insert: multmatrix([[2.22045e-16,-1,0,0],[1,1.77 (120 verts)
> CGAL Cache insert: multmatrix([[-0.309017,-0.951057,0,0],[0 (120 verts)
> CGAL Cache insert: multmatrix([[-0.587785,-0.809017,0,0],[0 (120 verts)
> CGAL Cache insert: multmatrix([[-0.809017,-0.587785,0,0],[0 (120 verts)
> CGAL Cache insert: multmatrix([[-0.951057,-0.309017,0,0],[0 (120 verts)
> CGAL Cache insert: multmatrix([[-1,-1.22461e-16,0,0],[1.224 (120 verts)
> CGAL Cache insert: multmatrix([[-0.951057,0.309017,0,0],[-0 (120 verts)
> CGAL Cache insert: multmatrix([[-0.809017,0.587785,0,0],[-0 (120 verts)
> CGAL Cache insert: multmatrix([[-0.587785,0.809017,0,0],[-0 (120 verts)
> CGAL Cache insert: multmatrix([[-0.309017,0.951057,0,0],[-0 (120 verts)
> CGAL Cache insert: multmatrix([[-2.22045e-16,1,0,0],[-1,-1. (120 verts)
> CGAL Cache insert: multmatrix([[0.309017,0.951057,0,0],[-0. (120 verts)
> CGAL Cache insert: multmatrix([[0.587785,0.809017,0,0],[-0. (120 verts)
> CGAL Cache insert: multmatrix([[0.809017,0.587785,0,0],[-0. (120 verts)
> CGAL Cache insert: multmatrix([[0.951057,0.309017,0,0],[-0. (120 verts)
> CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (2800 verts)
> CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (2800 verts)
> CGAL Cache insert: cube(size=[2,1,1],center=false); (8 verts)
> CGAL Cache insert: multmatrix([[1,0,0,-1],[0,1,0,39],[0,0,1 (8 verts)
> CGAL Cache insert: multmatrix([[1,0,0,-1],[0,1,0,-40],[0,0, (8 verts)
> CGAL Cache insert: group(){multmatrix([[1,0,0,-1],[0,1,0,39 (16 verts)
> CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,3 (16 verts)
> CGAL Cache insert: union(){difference(){group(){difference( (5670 verts)
> CGAL Cache insert: group(){union(){difference(){group(){dif (5670 verts)
> CGAL Cache insert: group(){group(){union(){difference(){gro (5670 verts)
> openscad: src/CGALEvaluator.cc:86: CGAL_Nef_polyhedron
> CGALEvaluator::applyToChildren(const AbstractNode&, CGALEvaluator::CsgOp):
> Assertion `isCached(*chnode)' failed.
> Aborted
> make: *** [lid.stl] Error 134
>
>
> On Mon, Oct 24, 2011 at 3:05 PM, Don Bright <***@gmail.com>wrote:
>
>> nevermind. i see it requires a script.
>> however the script doesn't work under mingw nor does it work under cygwin
>>
>>
>> On Mon, Oct 24, 2011 at 5:00 PM, Don Bright <***@gmail.com>
>> wrote:
>> > Sorry, I can't find pins.scad
>> >
>> >
>> > On Mon, Oct 24, 2011 at 12:36 AM, Michael Brown
>> > <***@michaels-house.net> wrote:
>> >> I am trying out openscad to make a few things, and I've run up against
>> a
>> >> brick wall in that my designs are previewing, but wont render or stl
>> export
>> >> in a 'reasonable' time. I'm using latest openscad git updated yesterday
>> on a
>> >> Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.
>> >> I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V,
>> >> (http://www.thingiverse.com/thing:7361
>> >> and http://www.thingiverse.com/thing:8928). I'm trying to make a
>> container
>> >> using the bracelet design as the sides and spiro coaster design for the
>> >> lid. I merged the scad programs, and basically rewrote a lot of it, so
>> it's
>> >> more 'inspired' by at this point, but it all previews nicely and looks
>> good.
>> >> My problem at this point is that it is taking *forever* to compile, and
>> >> using almost 2GB of ram. I'm trying to figure out why it is taking so
>> long.
>> >> I've uploaded my code to github
>> >> (https://github.com/superchalupa/container-round-decorative). Attached
>> is
>> >> the main module I've developed.
>> >> For comparison, I've re-compiled MakeALot's bracelet and it compiles in
>> >> about 41 minutes for me. When I redid the same basic bracelet design
>> with my
>> >> code, it literally took 23 hours. The object is fairly simple, so I am
>> at a
>> >> loss as to why it takes so long. It is a torus with about 100 oval
>> holes. At
>> >> first I was specifying $fn variables, but under the assumption that I
>> was
>> >> over-specifying things, I've removed almost all of those. The second
>> thing I
>> >> did was that I was using unit circles and scaling, which ends up using
>> only
>> >> 5 fragments, so I started using larger circles and different scaling
>> factors
>> >> to let openscad choose a more appropriate number of fragments. This has
>> not
>> >> seemed to help.
>> >> Calling my main module with this:
>> >>
>> >> // for my 3 year old (small)
>> >> radius=23;
>> >> bracelet_width=35;
>> >> wall_thick=3;
>> >> hole_len=8;
>> >> distance_between_holes=1;
>> >> hole_rotation_angle = 80;
>> >> num_divisions_around = 16;
>> >> edge_buffer=2;
>> >> holy_squished_hollow_torus(bracelet_width,
>> >> radius,
>> >> wall_thick,
>> >> edge_buffer,
>> >> hole_len,
>> >> distance_between_holes,
>> >> hole_rotation_angle,
>> >> num_divisions_around);
>> >>
>> >> Results in this:
>> >> time make bracelet.stl
>> >> openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename
>> bracelet.stl
>> >> .stl)\"
>> >> Compiling library
>> >>
>> `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
>> >> Compiling library
>> >> `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
>> >> ECHO: "y_step: ", 8.863269777109872
>> >> ECHO: "num big ovals: ", 3
>> >> ECHO: "degrees_per_y", 0.4392519091611444
>> >> ECHO: "leftover", 11
>> >> CGAL Cache insert: group(); (0 verts)
>> >> Number of polygons before reduction: 1
>> >> ... cut ...
>> >> CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340
>> verts)
>> >> CGAL Cache insert: difference(){group(){difference(){group( (26991
>> verts)
>> >> CGAL Cache insert: group(){group();group();group();group(); (26991
>> verts)
>> >> CGAL Cache insert: group(){group(){group();group();group(); (26991
>> verts)
>> >> real 1415m34.047s
>> >> user 1404m59.223s
>> >> sys 0m10.050s
>> >> --
>> >> Michael
>> >>
>> >>
>> >> _______________________________________________
>> >> OpenSCAD mailing list
>> >> ***@rocklinux.org
>> >> http://rocklinux.net/mailman/listinfo/openscad
>> >>
>> >>
>> >
>> _______________________________________________
>> OpenSCAD mailing list
>> ***@rocklinux.org
>> http://rocklinux.net/mailman/listinfo/openscad
>>
>
>
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
>
Marius Kintel
2011-10-25 03:13:44 UTC
Permalink
On Oct 25, 2011, at 00:50 AM, Brad Pitcher wrote:

> I get an assertion error when I make using tip:
>
This must be a bug. I'll look into it later this week.
If you manage to reproduce it with a smaller example it would be helpful to speed up my debugging process.

-Marius
Michael Brown
2011-10-25 04:45:47 UTC
Permalink
Attached is the smallest file I have (so far) that reproduces the abort. It
aborts with the following output:

$ time make bracelet-test-abort.stl
openscad -o bracelet-test-abort.stl bracelet-test-abort.scad
-Dlayout=\"$(basename bracelet-test-abort.stl .stl)\"
ECHO: "y_step: ", 8.457233587073175
ECHO: "num big ovals: ", 3
ECHO: "degrees_per_y_unit", 0.6516863321995306
ECHO: "leftover", 8
CGAL Cache insert: group(); (0 verts)
Number of polygons before reduction: 1

Number of polygons after reduction: 1

CGAL Cache insert: circle($fn=0,$fa=2.66667,$fs=0.222222,r= (139 verts)
Number of polygons before reduction: 133

Number of polygons after reduction: 1

CGAL Cache insert: multmatrix([[0.25,0,0,0],[0,0.546875,0,0 (139 verts)
Number of polygons before reduction: 133

Number of polygons after reduction: 1

CGAL Cache insert: multmatrix([[1,0,0,32],[0,1,0,0],[0,0,1, (139 verts)
CGAL Cache insert: rotate_extrude(convexity=2,$fn=0,$fa=4,$ (12150 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,1 (12150 verts)
CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (12150 verts)
Number of polygons before reduction: 133

Number of polygons after reduction: 1

CGAL Cache insert: multmatrix([[0.15625,0,0,0],[0,0.5,0,0], (139 verts)
Number of polygons before reduction: 133

Number of polygons after reduction: 1

CGAL Cache insert: multmatrix([[1,0,0,32],[0,1,0,0],[0,0,1, (139 verts)
CGAL Cache insert: rotate_extrude(convexity=2,$fn=0,$fa=4,$ (12150 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,1 (12150 verts)
CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (12150 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,1 (12150 verts)
CGAL Cache insert: difference(){group(){multmatrix([[1,0,0, (24300 verts)
CGAL Cache insert: group(){difference(){group(){multmatrix( (24300 verts)
CGAL Cache insert: cylinder($fn=0,$fa=12,$fs=1,h=40.1,r1=0, (14 verts)
CGAL Cache insert: multmatrix([[0.375,0,0,0],[0,1,0,0],[0,0 (14 verts)
CGAL Cache insert: multmatrix([[2.22045e-16,0,1,0],[0,1,0,0 (14 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,0.34202,-0.9396 (14 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,8 (14 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,0 (14 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,1 (14 verts)
CGAL Cache insert: multmatrix([[0.995377,-0.0960449,0,0],[0 (14 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,2 (14 verts)
CGAL Cache insert: multmatrix([[0.981551,-0.191202,0,0],[0. (14 verts)
CGAL Cache insert: group(){multmatrix([[1,0,0,0],[0,1,0,0], (42 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,1 (14 verts)
CGAL Cache insert: multmatrix([[0.952365,-0.30496,0,0],[0.3 (14 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,2 (14 verts)
CGAL Cache insert: multmatrix([[0.918673,-0.39502,0,0],[0.3 (14 verts)
CGAL Cache insert: group(){multmatrix([[0.952365,-0.30496,0 (28 verts)
CGAL Cache insert: multmatrix([[0.375,0,0,0],[0,0.5,0,0],[0 (14 verts)
CGAL Cache insert: multmatrix([[2.22045e-16,0,1,0],[0,1,0,0 (14 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,0.34202,-0.9396 (14 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,6 (14 verts)
CGAL Cache insert: multmatrix([[0.97187,-0.235518,0,0],[0.2 (14 verts)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,2 (14 verts)
CGAL Cache insert: multmatrix([[0.887809,-0.460212,0,0],[0. (14 verts)
CGAL Cache insert: multmatrix([[0.866025,-0.5,0,0],[0.5,0.8 (14 verts)
CGAL Cache insert: multmatrix([[0.813999,-0.580866,0,0],[0. (14 verts)
CGAL Cache insert: multmatrix([[0.754447,-0.656361,0,0],[0. (14 verts)
CGAL Cache insert: group(){multmatrix([[0.866025,-0.5,0,0], (42 verts)
CGAL Cache insert: multmatrix([[0.672293,-0.740285,0,0],[0. (14 verts)
CGAL Cache insert: multmatrix([[0.598084,-0.801433,0,0],[0. (14 verts)
CGAL Cache insert: group(){multmatrix([[0.672293,-0.740285, (28 verts)
CGAL Cache insert: multmatrix([[0.723905,-0.689899,0,0],[0. (14 verts)
CGAL Cache insert: multmatrix([[0.538759,-0.84246,0,0],[0.8 (14 verts)
CGAL Cache insert: multmatrix([[0.5,-0.866025,0,0],[0.86602 (14 verts)
CGAL Cache insert: multmatrix([[0.414511,-0.910044,0,0],[0. (14 verts)
CGAL Cache insert: multmatrix([[0.32519,-0.945649,0,0],[0.9 (14 verts)
CGAL Cache insert: group(){multmatrix([[0.5,-0.866025,0,0], (42 verts)
CGAL Cache insert: multmatrix([[0.21208,-0.977252,0,0],[0.9 (14 verts)
CGAL Cache insert: multmatrix([[0.117239,-0.993104,0,0],[0. (14 verts)
CGAL Cache insert: group(){multmatrix([[0.21208,-0.977252,0 (28 verts)
CGAL Cache insert: multmatrix([[0.281971,-0.959423,0,0],[0. (14 verts)
CGAL Cache insert: multmatrix([[0.0453492,-0.998971,0,0],[0 (14 verts)
CGAL Cache insert: multmatrix([[2.22045e-16,-1,0,0],[1,2.22 (14 verts)
CGAL Cache insert: multmatrix([[-0.0960449,-0.995377,0,0],[ (14 verts)
CGAL Cache insert: multmatrix([[-0.191202,-0.981551,0,0],[0 (14 verts)
CGAL Cache insert: group(){multmatrix([[2.22045e-16,-1,0,0] (42 verts)
CGAL Cache insert: multmatrix([[-0.30496,-0.952365,0,0],[0. (14 verts)
CGAL Cache insert: multmatrix([[-0.39502,-0.918673,0,0],[0. (14 verts)
CGAL Cache insert: group(){multmatrix([[-0.30496,-0.952365, (28 verts)
CGAL Cache insert: multmatrix([[-0.235518,-0.97187,0,0],[0. (14 verts)
CGAL Cache insert: multmatrix([[-0.460212,-0.887809,0,0],[0 (14 verts)
CGAL Cache insert: multmatrix([[-0.5,-0.866025,0,0],[0.8660 (14 verts)
CGAL Cache insert: multmatrix([[-0.580866,-0.813999,0,0],[0 (14 verts)
CGAL Cache insert: multmatrix([[-0.656361,-0.754447,0,0],[0 (14 verts)
CGAL Cache insert: group(){multmatrix([[-0.5,-0.866025,0,0] (42 verts)
CGAL Cache insert: multmatrix([[-0.740285,-0.672293,0,0],[0 (14 verts)
CGAL Cache insert: multmatrix([[-0.801433,-0.598084,0,0],[0 (14 verts)
CGAL Cache insert: group(){multmatrix([[-0.740285,-0.672293 (28 verts)
CGAL Cache insert: multmatrix([[-0.689899,-0.723905,0,0],[0 (14 verts)
CGAL Cache insert: multmatrix([[-0.84246,-0.538759,0,0],[0. (14 verts)
CGAL Cache insert: multmatrix([[-0.866025,-0.5,0,0],[0.5,-0 (14 verts)
CGAL Cache insert: multmatrix([[-0.910044,-0.414511,0,0],[0 (14 verts)
CGAL Cache insert: multmatrix([[-0.945649,-0.32519,0,0],[0. (14 verts)
CGAL Cache insert: group(){multmatrix([[-0.866025,-0.5,0,0] (42 verts)
CGAL Cache insert: multmatrix([[-0.977252,-0.21208,0,0],[0. (14 verts)
CGAL Cache insert: multmatrix([[-0.993104,-0.117239,0,0],[0 (14 verts)
CGAL Cache insert: group(){multmatrix([[-0.977252,-0.21208, (28 verts)
CGAL Cache insert: multmatrix([[-0.959423,-0.281971,0,0],[0 (14 verts)
CGAL Cache insert: multmatrix([[-0.998971,-0.0453492,0,0],[ (14 verts)
CGAL Cache insert: multmatrix([[-1,-1.22461e-16,0,0],[1.224 (14 verts)
CGAL Cache insert: multmatrix([[-0.995377,0.0960449,0,0],[- (14 verts)
CGAL Cache insert: multmatrix([[-0.981551,0.191202,0,0],[-0 (14 verts)
CGAL Cache insert: group(){multmatrix([[-1,-1.22461e-16,0,0 (42 verts)
CGAL Cache insert: multmatrix([[-0.952365,0.30496,0,0],[-0. (14 verts)
CGAL Cache insert: multmatrix([[-0.918673,0.39502,0,0],[-0. (14 verts)
CGAL Cache insert: group(){multmatrix([[-0.952365,0.30496,0 (28 verts)
CGAL Cache insert: multmatrix([[-0.97187,0.235518,0,0],[-0. (14 verts)
CGAL Cache insert: multmatrix([[-0.887809,0.460212,0,0],[-0 (14 verts)
CGAL Cache insert: multmatrix([[-0.866025,0.5,0,0],[-0.5,-0 (14 verts)
CGAL Cache insert: multmatrix([[-0.813999,0.580866,0,0],[-0 (14 verts)
CGAL Cache insert: multmatrix([[-0.754447,0.656361,0,0],[-0 (14 verts)
CGAL Cache insert: group(){multmatrix([[-0.866025,0.5,0,0], (42 verts)
CGAL Cache insert: multmatrix([[-0.672293,0.740285,0,0],[-0 (14 verts)
CGAL Cache insert: multmatrix([[-0.598084,0.801433,0,0],[-0 (14 verts)
CGAL Cache insert: group(){multmatrix([[-0.672293,0.740285, (28 verts)
CGAL Cache insert: multmatrix([[-0.723905,0.689899,0,0],[-0 (14 verts)
CGAL Cache insert: multmatrix([[-0.538759,0.84246,0,0],[-0. (14 verts)
CGAL Cache insert: multmatrix([[-0.5,0.866025,0,0],[-0.8660 (14 verts)
CGAL Cache insert: multmatrix([[-0.414511,0.910044,0,0],[-0 (14 verts)
CGAL Cache insert: multmatrix([[-0.32519,0.945649,0,0],[-0. (14 verts)
CGAL Cache insert: group(){multmatrix([[-0.5,0.866025,0,0], (42 verts)
CGAL Cache insert: multmatrix([[-0.21208,0.977252,0,0],[-0. (14 verts)
CGAL Cache insert: multmatrix([[-0.117239,0.993104,0,0],[-0 (14 verts)
CGAL Cache insert: group(){multmatrix([[-0.21208,0.977252,0 (28 verts)
CGAL Cache insert: multmatrix([[-0.281971,0.959423,0,0],[-0 (14 verts)
CGAL Cache insert: multmatrix([[-0.0453492,0.998971,0,0],[- (14 verts)
CGAL Cache insert: multmatrix([[-2.22045e-16,1,0,0],[-1,-2. (14 verts)
CGAL Cache insert: multmatrix([[0.0960449,0.995377,0,0],[-0 (14 verts)
CGAL Cache insert: multmatrix([[0.191202,0.981551,0,0],[-0. (14 verts)
CGAL Cache insert: group(){multmatrix([[-2.22045e-16,1,0,0] (42 verts)
CGAL Cache insert: multmatrix([[0.30496,0.952365,0,0],[-0.9 (14 verts)
CGAL Cache insert: multmatrix([[0.39502,0.918673,0,0],[-0.9 (14 verts)
CGAL Cache insert: group(){multmatrix([[0.30496,0.952365,0, (28 verts)
CGAL Cache insert: multmatrix([[0.235518,0.97187,0,0],[-0.9 (14 verts)
CGAL Cache insert: multmatrix([[0.460212,0.887809,0,0],[-0. (14 verts)
CGAL Cache insert: multmatrix([[0.5,0.866025,0,0],[-0.86602 (14 verts)
CGAL Cache insert: multmatrix([[0.580866,0.813999,0,0],[-0. (14 verts)
CGAL Cache insert: multmatrix([[0.656361,0.754447,0,0],[-0. (14 verts)
CGAL Cache insert: group(){multmatrix([[0.5,0.866025,0,0],[ (42 verts)
CGAL Cache insert: multmatrix([[0.740285,0.672293,0,0],[-0. (14 verts)
CGAL Cache insert: multmatrix([[0.801433,0.598084,0,0],[-0. (14 verts)
CGAL Cache insert: group(){multmatrix([[0.740285,0.672293,0 (28 verts)
CGAL Cache insert: multmatrix([[0.689899,0.723905,0,0],[-0. (14 verts)
CGAL Cache insert: multmatrix([[0.84246,0.538759,0,0],[-0.5 (14 verts)
CGAL Cache insert: multmatrix([[0.866025,0.5,0,0],[-0.5,0.8 (14 verts)
CGAL Cache insert: multmatrix([[0.910044,0.414511,0,0],[-0. (14 verts)
CGAL Cache insert: multmatrix([[0.945649,0.32519,0,0],[-0.3 (14 verts)
CGAL Cache insert: group(){multmatrix([[0.866025,0.5,0,0],[ (42 verts)
CGAL Cache insert: multmatrix([[0.977252,0.21208,0,0],[-0.2 (14 verts)
CGAL Cache insert: multmatrix([[0.993104,0.117239,0,0],[-0. (14 verts)
CGAL Cache insert: group(){multmatrix([[0.977252,0.21208,0, (28 verts)
CGAL Cache insert: multmatrix([[0.959423,0.281971,0,0],[-0. (14 verts)
CGAL Cache insert: multmatrix([[0.998971,0.0453492,0,0],[-0 (14 verts)
CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (1099 verts)
CGAL Cache insert: difference(){group(){difference(){group( (37396 verts)
openscad: src/CGALEvaluator.cc:86: CGAL_Nef_polyhedron
CGALEvaluator::applyToChildren(const AbstractNode&, CGALEvaluator::CsgOp):
Assertion `isCached(*chnode)' failed.
make: *** [bracelet-test-abort.stl] Aborted

real 9m57.897s
user 9m52.110s
sys 0m1.015s




On Mon, Oct 24, 2011 at 10:13 PM, Marius Kintel <***@kintel.net> wrote:

> On Oct 25, 2011, at 00:50 AM, Brad Pitcher wrote:
>
> > I get an assertion error when I make using tip:
> >
> This must be a bug. I'll look into it later this week.
> If you manage to reproduce it with a smaller example it would be helpful to
> speed up my debugging process.
>
> -Marius
>
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
William Adams
2011-10-25 14:35:35 UTC
Permalink
Looking at the sources, it seems to me that the following should work: color(c="beige")cube(size=[10,10,10]) Was that added after the 2011.06 release? Or am I just doing it wrong? -- William

===============================

- Shaping clay is easier than digging it out of the ground.


http://blog.nanotechstyles.com
http://www.thingiverse.com/WilliamAAdams
https://github.com/Wiladams
Don Bright
2011-10-25 22:09:11 UTC
Permalink
Yes it was added after 2011.06 release.


On Tue, Oct 25, 2011 at 9:35 AM, William Adams <***@msn.com> wrote:
> Looking at the sources, it seems to me that the following should work:
>
> color(c="beige")
> cube(size=[10,10,10])
>
> Was that added after the 2011.06 release?  Or am I just doing it wrong?
>
> -- William
>
> ===============================
> - Shaping clay is easier than digging it out of the ground.
>
> http://blog.nanotechstyles.com
> http://www.thingiverse.com/WilliamAAdams
> https://github.com/Wiladams
>
>
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
>
William Adams
2011-10-26 13:36:10 UTC
Permalink
I am wanting to implement a function that has the following pattern func(x) = (x<<13) & 0x7fffffff; Am I safe in assuming I can NOT do this in OpenScad? I don't think the left shift, nor the int32 '&' operator are implemented. Is that a correct assumption? -- William

===============================

- Shaping clay is easier than digging it out of the ground.


http://blog.nanotechstyles.com
http://www.thingiverse.com/WilliamAAdams
https://github.com/Wiladams
Giles Bathgate
2011-10-26 13:42:25 UTC
Permalink
On 26 October 2011 14:36, William Adams <***@msn.com> wrote:
> I am wanting to implement a function that has the following pattern
>
> func(x) = (x<<13) & 0x7fffffff;
>
> Am I safe in assuming I can NOT do this in OpenScad?

No none of that is supported, and in addition neither are hexidecimal
constants?!

Why are you trying to do this?

Regards

Giles.
William Adams
2011-10-26 14:38:23 UTC
Permalink
pelin noise. I've actually implemented these operators using OpenScad itself. It's not pretty, nor fast, but it actually works. I was just curious as to whether I was wasting my time because it was going to get baked into the language. I've implemented all the boolean algebra for single bits, and 32bit, and done the LSHIFT, and RSHIFT as well. -- William

===============================

- Shaping clay is easier than digging it out of the ground.


http://blog.nanotechstyles.com
http://www.thingiverse.com/WilliamAAdams
https://github.com/Wiladams


> Date: Wed, 26 Oct 2011 14:42:25 +0100
> From: ***@gmail.com
> To: ***@rocklinux.org
> Subject: Re: [OpenSCAD] boolean logic in openscad
>
> On 26 October 2011 14:36, William Adams <***@msn.com> wrote:
> > I am wanting to implement a function that has the following pattern
> >
> > func(x) = (x<<13) & 0x7fffffff;
> >
> > Am I safe in assuming I can NOT do this in OpenScad?
>
> No none of that is supported, and in addition neither are hexidecimal
> constants?!
>
> Why are you trying to do this?
>
> Regards
>
> Giles.
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
William Adams
2011-10-26 14:39:16 UTC
Permalink
that's 'Perlin' noise. I dropped an 'r' there.

===============================

- Shaping clay is easier than digging it out of the ground.


http://blog.nanotechstyles.com
http://www.thingiverse.com/WilliamAAdams
https://github.com/Wiladams


From: ***@msn.com
To: ***@rocklinux.org
Date: Wed, 26 Oct 2011 14:38:23 +0000
Subject: Re: [OpenSCAD] boolean logic in openscad








pelin noise.

I've actually implemented these operators using OpenScad itself. It's not pretty, nor fast, but it actually works. I was just curious as to whether I was wasting my time because it was going to get baked into the language.

I've implemented all the boolean algebra for single bits, and 32bit, and done the LSHIFT, and RSHIFT as well.

-- William

===============================

- Shaping clay is easier than digging it out of the ground.


http://blog.nanotechstyles.com
http://www.thingiverse.com/WilliamAAdams
https://github.com/Wiladams



> Date: Wed, 26 Oct 2011 14:42:25 +0100
> From: ***@gmail.com
> To: ***@rocklinux.org
> Subject: Re: [OpenSCAD] boolean logic in openscad
>
> On 26 October 2011 14:36, William Adams <***@msn.com> wrote:
> > I am wanting to implement a function that has the following pattern
> >
> > func(x) = (x<<13) & 0x7fffffff;
> >
> > Am I safe in assuming I can NOT do this in OpenScad?
>
> No none of that is supported, and in addition neither are hexidecimal
> constants?!
>
> Why are you trying to do this?
>
> Regards
>
> Giles.
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
chrysn
2011-10-26 17:50:09 UTC
Permalink
On Wed, Oct 26, 2011 at 01:36:10PM +0000, William Adams wrote:
> I am wanting to implement a function that has the following pattern
> func(x) = (x<<13) & 0x7fffffff[...]?

are you aware that this is just the same as func(x) = (x*8192) % 2147483648;
(that is, in more readable but non-openscad notation, x*(2^13) % 0x80000000)?

(at least, if you expect x to behave like an integer -- i couldn't
correlate your sniplet to the source code i found when quickly looking
it up[1].)

regards
chrysn

[1] http://mrl.nyu.edu/~perlin/doc/oscar.html#noise

--
To use raw power is to make yourself infinitely vulnerable to greater powers.
-- Bene Gesserit axiom
William Adams
2011-10-26 18:29:10 UTC
Permalink
Why yes! In fact, the way I implemented it was: function LSHIFT(x,pos=1) = x * pow(2,pos); and opposite for RSHIFT. Also, sometimes I need '&', sometimes I need '|', and sometimes I need '^' (xor). And sometimes I need NAND, etc. So, I just implement them as simple macros. That way I don't have to remember my powers of 2 whenever I want to use them. So, in this case, it turns into: func(x) = 32BITAND((LSHIFT(x,13)), 2147483648); That's really easy for my small brain to wrap around, because if I do it more than once, it's nice to have it done correctly every time. It would be nice if the boolean algebra were just there, and hex notation was supported. I think hex notation is coming, so that will be nice. -- William

===============================

- Shaping clay is easier than digging it out of the ground.


http://blog.nanotechstyles.com
http://www.thingiverse.com/WilliamAAdams
https://github.com/Wiladams


Date: Wed, 26 Oct 2011 19:50:09 +0200
From: ***@fsfe.org
To: ***@rocklinux.org
Subject: Re: [OpenSCAD] boolean logic in openscad

On Wed, Oct 26, 2011 at 01:36:10PM +0000, William Adams wrote:
> I am wanting to implement a function that has the following pattern
> func(x) = (x<<13) & 0x7fffffff[...]?

are you aware that this is just the same as func(x) = (x*8192) % 2147483648;
(that is, in more readable but non-openscad notation, x*(2^13) % 0x80000000)?

(at least, if you expect x to behave like an integer -- i couldn't
correlate your sniplet to the source code i found when quickly looking
it up[1].)

regards
chrysn

[1] http://mrl.nyu.edu/~perlin/doc/oscar.html#noise

--
To use raw power is to make yourself infinitely vulnerable to greater powers.
-- Bene Gesserit axiom
William Adams
2011-10-26 18:33:24 UTC
Permalink
My code reference comes from here:http://freespace.virgin.net/hugo.elias/models/m_perlin.htm Really what I want is to port the simplex noise functions that I have written in C#, but I can't because they require me to use static arrays of values. That has proven to be very cost prohibitive in OpenScad, so I am reimplementing using an approach that does not require any storage. It's a bit slower, but not as slow as the array accesses become over time. -- William

===============================

- Shaping clay is easier than digging it out of the ground.


http://blog.nanotechstyles.com
http://www.thingiverse.com/WilliamAAdams
https://github.com/Wiladams


From: ***@msn.com
To: ***@rocklinux.org
Date: Wed, 26 Oct 2011 18:29:10 +0000
Subject: Re: [OpenSCAD] boolean logic in openscad








Why yes! In fact, the way I implemented it was:

function LSHIFT(x,pos=1) = x * pow(2,pos);

and opposite for RSHIFT.

Also, sometimes I need '&', sometimes I need '|', and sometimes I need '^' (xor). And sometimes I need NAND, etc. So, I just implement them as simple macros.

That way I don't have to remember my powers of 2 whenever I want to use them. So, in this case, it turns into:

func(x) = 32BITAND((LSHIFT(x,13)), 2147483648);

That's really easy for my small brain to wrap around, because if I do it more than once, it's nice to have it done correctly every time.

It would be nice if the boolean algebra were just there, and hex notation was supported. I think hex notation is coming, so that will be nice.

-- William

===============================

- Shaping clay is easier than digging it out of the ground.


http://blog.nanotechstyles.com
http://www.thingiverse.com/WilliamAAdams
https://github.com/Wiladams



Date: Wed, 26 Oct 2011 19:50:09 +0200
From: ***@fsfe.org
To: ***@rocklinux.org
Subject: Re: [OpenSCAD] boolean logic in openscad

On Wed, Oct 26, 2011 at 01:36:10PM +0000, William Adams wrote:
> I am wanting to implement a function that has the following pattern
> func(x) = (x<<13) & 0x7fffffff[...]?

are you aware that this is just the same as func(x) = (x*8192) % 2147483648;
(that is, in more readable but non-openscad notation, x*(2^13) % 0x80000000)?

(at least, if you expect x to behave like an integer -- i couldn't
correlate your sniplet to the source code i found when quickly looking
it up[1].)

regards
chrysn

[1] http://mrl.nyu.edu/~perlin/doc/oscar.html#noise

--
To use raw power is to make yourself infinitely vulnerable to greater powers.
-- Bene Gesserit axiom
Don Bright
2011-10-26 22:41:25 UTC
Permalink
If you want to add stuff like this, hack on the following files:

parser.y
lexer.l
value.cc
value.h
expr.cc

I added bitwise AND in about 20 minutes. The problem is that in Openscad
you deal with it's Value type, and if that is a NUMBER it is using a
C++ "double"
in the underlying code.

This means very weird and/or unexpected results sometimes. (like, what
shoudl the bitwise AND of 3.4 and 4.6 be? See more by googling
"bitwise float double"

My version just 'casts' the dobule to unsigned int, then bitwise ANDs
the two uints,
and then casts back into double for the resulting Value().

This could cause some very weird and/or unexpected behavior in some cases.

-DB


On Wed, Oct 26, 2011 at 1:33 PM, William Adams <***@msn.com> wrote:
> My code reference comes from here:
> http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
>
> Really what I want is to port the simplex noise functions that I have
> written in C#, but I can't because they require me to use static arrays of
> values.  That has proven to be very cost prohibitive in OpenScad, so I am
> reimplementing using an approach that does not require any storage.  It's a
> bit slower, but not as slow as the array accesses become over time.
>
> -- William
>
> ===============================
> - Shaping clay is easier than digging it out of the ground.
>
> http://blog.nanotechstyles.com
> http://www.thingiverse.com/WilliamAAdams
> https://github.com/Wiladams
>
>
>
> ________________________________
> From: ***@msn.com
> To: ***@rocklinux.org
> Date: Wed, 26 Oct 2011 18:29:10 +0000
> Subject: Re: [OpenSCAD] boolean logic in openscad
>
> Why yes!  In fact, the way I implemented it was:
>
> function LSHIFT(x,pos=1) = x * pow(2,pos);
>
> and opposite for RSHIFT.
>
> Also, sometimes I need '&', sometimes I need '|', and sometimes I need '^'
> (xor).  And sometimes I need NAND, etc.  So, I just implement them as simple
> macros.
>
> That way I don't have to remember my powers of 2 whenever I want to use
> them.  So, in this case, it turns into:
>
> func(x) = 32BITAND((LSHIFT(x,13)), 2147483648);
>
> That's really easy for my small brain to wrap around, because if I do it
> more than once, it's nice to have it done correctly every time.
>
> It would be nice if the boolean algebra were just there, and hex notation
> was supported.  I think hex notation is coming, so that will be nice.
>
> -- William
>
> ===============================
> - Shaping clay is easier than digging it out of the ground.
>
> http://blog.nanotechstyles.com
> http://www.thingiverse.com/WilliamAAdams
> https://github.com/Wiladams
>
>
>
> Date: Wed, 26 Oct 2011 19:50:09 +0200
> From: ***@fsfe.org
> To: ***@rocklinux.org
> Subject: Re: [OpenSCAD] boolean logic in openscad
>
> On Wed, Oct 26, 2011 at 01:36:10PM +0000, William Adams wrote:
>> I am wanting to implement a function that has the following pattern
>> func(x) = (x<<13) & 0x7fffffff[...]?
>
> are you aware that this is just the same as func(x) = (x*8192) % 2147483648;
> (that is, in more readable but non-openscad notation, x*(2^13) %
> 0x80000000)?
>
> (at least, if you expect x to behave like an integer -- i couldn't
> correlate your sniplet to the source code i found when quickly looking
> it up[1].)
>
> regards
> chrysn
>
> [1] http://mrl.nyu.edu/~perlin/doc/oscar.html#noise
>
> --
> To use raw power is to make yourself infinitely vulnerable to greater
> powers.
> -- Bene Gesserit axiom
>
> _______________________________________________ OpenSCAD mailing list
> ***@rocklinux.org http://rocklinux.net/mailman/listinfo/openscad
> _______________________________________________ OpenSCAD mailing list
> ***@rocklinux.org http://rocklinux.net/mailman/listinfo/openscad
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
>
William Adams
2011-10-26 22:47:28 UTC
Permalink
Havint that sort of behavior would be great I think. I would imagine that most people who want to do boolean algebra will be dealing with integer values. But yah, from a completeness standpoint, without an actual separation between float/double, and int types, it could be confusing. Sometimes I need AND, sometimes OR, sometimes XOR. Those are probably the most common cases. Then of course there's the bit shifting operators. They can all be simulated, but the more that are baked in, the better from a performance perspective. -- William

===============================

- Shaping clay is easier than digging it out of the ground.


http://blog.nanotechstyles.com
http://www.thingiverse.com/WilliamAAdams
https://github.com/Wiladams


> Date: Wed, 26 Oct 2011 17:41:25 -0500
> From: ***@gmail.com
> To: ***@rocklinux.org
> Subject: Re: [OpenSCAD] boolean logic in openscad
>
> If you want to add stuff like this, hack on the following files:
>
> parser.y
> lexer.l
> value.cc
> value.h
> expr.cc
>
> I added bitwise AND in about 20 minutes. The problem is that in Openscad
> you deal with it's Value type, and if that is a NUMBER it is using a
> C++ "double"
> in the underlying code.
>
> This means very weird and/or unexpected results sometimes. (like, what
> shoudl the bitwise AND of 3.4 and 4.6 be? See more by googling
> "bitwise float double"
>
> My version just 'casts' the dobule to unsigned int, then bitwise ANDs
> the two uints,
> and then casts back into double for the resulting Value().
>
> This could cause some very weird and/or unexpected behavior in some cases.
>
> -DB
>
>
> On Wed, Oct 26, 2011 at 1:33 PM, William Adams <***@msn.com> wrote:
> > My code reference comes from here:
> > http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
> >
> > Really what I want is to port the simplex noise functions that I have
> > written in C#, but I can't because they require me to use static arrays of
> > values. That has proven to be very cost prohibitive in OpenScad, so I am
> > reimplementing using an approach that does not require any storage. It's a
> > bit slower, but not as slow as the array accesses become over time.
> >
> > -- William
> >
> > ===============================
> > - Shaping clay is easier than digging it out of the ground.
> >
> > http://blog.nanotechstyles.com
> > http://www.thingiverse.com/WilliamAAdams
> > https://github.com/Wiladams
> >
> >
> >
> > ________________________________
> > From: ***@msn.com
> > To: ***@rocklinux.org
> > Date: Wed, 26 Oct 2011 18:29:10 +0000
> > Subject: Re: [OpenSCAD] boolean logic in openscad
> >
> > Why yes! In fact, the way I implemented it was:
> >
> > function LSHIFT(x,pos=1) = x * pow(2,pos);
> >
> > and opposite for RSHIFT.
> >
> > Also, sometimes I need '&', sometimes I need '|', and sometimes I need '^'
> > (xor). And sometimes I need NAND, etc. So, I just implement them as simple
> > macros.
> >
> > That way I don't have to remember my powers of 2 whenever I want to use
> > them. So, in this case, it turns into:
> >
> > func(x) = 32BITAND((LSHIFT(x,13)), 2147483648);
> >
> > That's really easy for my small brain to wrap around, because if I do it
> > more than once, it's nice to have it done correctly every time.
> >
> > It would be nice if the boolean algebra were just there, and hex notation
> > was supported. I think hex notation is coming, so that will be nice.
> >
> > -- William
> >
> > ===============================
> > - Shaping clay is easier than digging it out of the ground.
> >
> > http://blog.nanotechstyles.com
> > http://www.thingiverse.com/WilliamAAdams
> > https://github.com/Wiladams
> >
> >
> >
> > Date: Wed, 26 Oct 2011 19:50:09 +0200
> > From: ***@fsfe.org
> > To: ***@rocklinux.org
> > Subject: Re: [OpenSCAD] boolean logic in openscad
> >
> > On Wed, Oct 26, 2011 at 01:36:10PM +0000, William Adams wrote:
> >> I am wanting to implement a function that has the following pattern
> >> func(x) = (x<<13) & 0x7fffffff[...]?
> >
> > are you aware that this is just the same as func(x) = (x*8192) % 2147483648;
> > (that is, in more readable but non-openscad notation, x*(2^13) %
> > 0x80000000)?
> >
> > (at least, if you expect x to behave like an integer -- i couldn't
> > correlate your sniplet to the source code i found when quickly looking
> > it up[1].)
> >
> > regards
> > chrysn
> >
> > [1] http://mrl.nyu.edu/~perlin/doc/oscar.html#noise
> >
> > --
> > To use raw power is to make yourself infinitely vulnerable to greater
> > powers.
> > -- Bene Gesserit axiom
> >
> > _______________________________________________ OpenSCAD mailing list
> > ***@rocklinux.org http://rocklinux.net/mailman/listinfo/openscad
> > _______________________________________________ OpenSCAD mailing list
> > ***@rocklinux.org http://rocklinux.net/mailman/listinfo/openscad
> > _______________________________________________
> > OpenSCAD mailing list
> > ***@rocklinux.org
> > http://rocklinux.net/mailman/listinfo/openscad
> >
> >
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
Don Bright
2011-10-26 22:57:40 UTC
Permalink
considering STL only outputs one color, this 3d procedural texture stuff might
be a little ahead of its time... (i.e. might be higher priority to stop openscad
from constantly crashing machines)

but i can see it 10 years from now:

color("wood_grain1") sphere(5);

And the color 3d printer spits out a wood-grained sphere. hopefully
not with your name on it (sorry, cant resist PKD reference)

-DB

On Wed, Oct 26, 2011 at 5:47 PM, William Adams <***@msn.com> wrote:
> Havint that sort of behavior would be great I think.  I would imagine that
> most people who want to do boolean algebra will be dealing with integer
> values.  But yah, from a completeness standpoint, without an actual
> separation between float/double, and int types, it could be confusing.
>
> Sometimes I need AND, sometimes OR, sometimes XOR.  Those are probably the
> most common cases.  Then of course there's the bit shifting operators.  They
> can all be simulated, but the more that are baked in, the better from a
> performance perspective.
>
> -- William
>
> ===============================
> - Shaping clay is easier than digging it out of the ground.
>
> http://blog.nanotechstyles.com
> http://www.thingiverse.com/WilliamAAdams
> https://github.com/Wiladams
>
>
>
>> Date: Wed, 26 Oct 2011 17:41:25 -0500
>> From: ***@gmail.com
>> To: ***@rocklinux.org
>> Subject: Re: [OpenSCAD] boolean logic in openscad
>>
>> If you want to add stuff like this, hack on the following files:
>>
>> parser.y
>> lexer.l
>> value.cc
>> value.h
>> expr.cc
>>
>> I added bitwise AND in about 20 minutes. The problem is that in Openscad
>> you deal with it's Value type, and if that is a NUMBER it is using a
>> C++ "double"
>> in the underlying code.
>>
>> This means very weird and/or unexpected results sometimes. (like, what
>> shoudl the bitwise AND of 3.4 and 4.6 be? See more by googling
>> "bitwise float double"
>>
>> My version just 'casts' the dobule to unsigned int, then bitwise ANDs
>> the two uints,
>> and then casts back into double for the resulting Value().
>>
>> This could cause some very weird and/or unexpected behavior in some cases.
>>
>> -DB
>>
>>
>> On Wed, Oct 26, 2011 at 1:33 PM, William Adams <***@msn.com>
>> wrote:
>> > My code reference comes from here:
>> > http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
>> >
>> > Really what I want is to port the simplex noise functions that I have
>> > written in C#, but I can't because they require me to use static arrays
>> > of
>> > values.  That has proven to be very cost prohibitive in OpenScad, so I
>> > am
>> > reimplementing using an approach that does not require any storage.
>> > It's a
>> > bit slower, but not as slow as the array accesses become over time.
>> >
>> > -- William
>> >
>> > ===============================
>> > - Shaping clay is easier than digging it out of the ground.
>> >
>> > http://blog.nanotechstyles.com
>> > http://www.thingiverse.com/WilliamAAdams
>> > https://github.com/Wiladams
>> >
>> >
>> >
>> > ________________________________
>> > From: ***@msn.com
>> > To: ***@rocklinux.org
>> > Date: Wed, 26 Oct 2011 18:29:10 +0000
>> > Subject: Re: [OpenSCAD] boolean logic in openscad
>> >
>> > Why yes!  In fact, the way I implemented it was:
>> >
>> > function LSHIFT(x,pos=1) = x * pow(2,pos);
>> >
>> > and opposite for RSHIFT.
>> >
>> > Also, sometimes I need '&', sometimes I need '|', and sometimes I need
>> > '^'
>> > (xor).  And sometimes I need NAND, etc.  So, I just implement them as
>> > simple
>> > macros.
>> >
>> > That way I don't have to remember my powers of 2 whenever I want to use
>> > them.  So, in this case, it turns into:
>> >
>> > func(x) = 32BITAND((LSHIFT(x,13)), 2147483648);
>> >
>> > That's really easy for my small brain to wrap around, because if I do it
>> > more than once, it's nice to have it done correctly every time.
>> >
>> > It would be nice if the boolean algebra were just there, and hex
>> > notation
>> > was supported.  I think hex notation is coming, so that will be nice.
>> >
>> > -- William
>> >
>> > ===============================
>> > - Shaping clay is easier than digging it out of the ground.
>> >
>> > http://blog.nanotechstyles.com
>> > http://www.thingiverse.com/WilliamAAdams
>> > https://github.com/Wiladams
>> >
>> >
>> >
>> > Date: Wed, 26 Oct 2011 19:50:09 +0200
>> > From: ***@fsfe.org
>> > To: ***@rocklinux.org
>> > Subject: Re: [OpenSCAD] boolean logic in openscad
>> >
>> > On Wed, Oct 26, 2011 at 01:36:10PM +0000, William Adams wrote:
>> >> I am wanting to implement a function that has the following pattern
>> >> func(x) = (x<<13) & 0x7fffffff[...]?
>> >
>> > are you aware that this is just the same as func(x) = (x*8192) %
>> > 2147483648;
>> > (that is, in more readable but non-openscad notation, x*(2^13) %
>> > 0x80000000)?
>> >
>> > (at least, if you expect x to behave like an integer -- i couldn't
>> > correlate your sniplet to the source code i found when quickly looking
>> > it up[1].)
>> >
>> > regards
>> > chrysn
>> >
>> > [1] http://mrl.nyu.edu/~perlin/doc/oscar.html#noise
>> >
>> > --
>> > To use raw power is to make yourself infinitely vulnerable to greater
>> > powers.
>> > -- Bene Gesserit axiom
>> >
>> > _______________________________________________ OpenSCAD mailing list
>> > ***@rocklinux.org http://rocklinux.net/mailman/listinfo/openscad
>> > _______________________________________________ OpenSCAD mailing list
>> > ***@rocklinux.org http://rocklinux.net/mailman/listinfo/openscad
>> > _______________________________________________
>> > OpenSCAD mailing list
>> > ***@rocklinux.org
>> > http://rocklinux.net/mailman/listinfo/openscad
>> >
>> >
>> _______________________________________________
>> OpenSCAD mailing list
>> ***@rocklinux.org
>> http://rocklinux.net/mailman/listinfo/openscad
>
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
>
William Adams
2011-10-27 00:03:01 UTC
Permalink
Today, OpenScad does not output colors in .stl. Such is the nature of .stl. I think DXF does not have this particular limitation, although OpenScad does not use it in that way.
But, it's not just about color.
I did texture mapping in OpenScad: http://www.thingiverse.com/thing:11616
that was fun, and helped me figure out some of the limitations of doing large array accesses repeatedly in OpenScad.
Then I started doing height mapping: http://www.thingiverse.com/thing:11981
This is where things might get a little more interesting. I used a grayscale image, that was originally generated from a Perlin Noise function. Really I don't need the intermediate image. If I could get the values out of a function directly, I could just do height maps directly. No need for arrays, and pretty fast to boot. And, since it's a function, it can be as complex as I care to make it. I can map a whole mountain scene using this technique.
Then, there is in fact the use of color: http://www.thingiverse.com/thing:12770
Here I'm using it not for printing purposes, but simply for visuals while I'm 'rendering'. It helps me debug things. Not strictly having anything to do with Perlin Noise, but just showing that color can be used in many ways in OpenScad, even if it's not to be in the final printed object.
Yes, there are many things that are WAYYYYYY more important than this with respect to OpenScad. I got my original questions answered as to whether these particular capabilities were currently baked in. I'm perfectly happy to just continue using OpenScad as it is, filling in what I need when I need it.
Thanks for all the responses.
-- William

===============================

- Shaping clay is easier than digging it out of the ground.


http://blog.nanotechstyles.com
http://www.thingiverse.com/WilliamAAdams
https://github.com/Wiladams



> Date: Wed, 26 Oct 2011 17:57:40 -0500
> From: ***@gmail.com
> To: ***@rocklinux.org
> Subject: Re: [OpenSCAD] boolean logic in openscad
>
> considering STL only outputs one color, this 3d procedural texture stuff might
> be a little ahead of its time... (i.e. might be higher priority to stop openscad
> from constantly crashing machines)
>
> but i can see it 10 years from now:
>
> color("wood_grain1") sphere(5);
>
> And the color 3d printer spits out a wood-grained sphere. hopefully
> not with your name on it (sorry, cant resist PKD reference)
>
> -DB
>
> On Wed, Oct 26, 2011 at 5:47 PM, William Adams <***@msn.com> wrote:
> > Havint that sort of behavior would be great I think. I would imagine that
> > most people who want to do boolean algebra will be dealing with integer
> > values. But yah, from a completeness standpoint, without an actual
> > separation between float/double, and int types, it could be confusing.
> >
> > Sometimes I need AND, sometimes OR, sometimes XOR. Those are probably the
> > most common cases. Then of course there's the bit shifting operators. They
> > can all be simulated, but the more that are baked in, the better from a
> > performance perspective.
> >
> > -- William
> >
> > ===============================
> > - Shaping clay is easier than digging it out of the ground.
> >
> > http://blog.nanotechstyles.com
> > http://www.thingiverse.com/WilliamAAdams
> > https://github.com/Wiladams
> >
> >
> >
> >> Date: Wed, 26 Oct 2011 17:41:25 -0500
> >> From: ***@gmail.com
> >> To: ***@rocklinux.org
> >> Subject: Re: [OpenSCAD] boolean logic in openscad
> >>
> >> If you want to add stuff like this, hack on the following files:
> >>
> >> parser.y
> >> lexer.l
> >> value.cc
> >> value.h
> >> expr.cc
> >>
> >> I added bitwise AND in about 20 minutes. The problem is that in Openscad
> >> you deal with it's Value type, and if that is a NUMBER it is using a
> >> C++ "double"
> >> in the underlying code.
> >>
> >> This means very weird and/or unexpected results sometimes. (like, what
> >> shoudl the bitwise AND of 3.4 and 4.6 be? See more by googling
> >> "bitwise float double"
> >>
> >> My version just 'casts' the dobule to unsigned int, then bitwise ANDs
> >> the two uints,
> >> and then casts back into double for the resulting Value().
> >>
> >> This could cause some very weird and/or unexpected behavior in some cases.
> >>
> >> -DB
> >>
> >>
> >> On Wed, Oct 26, 2011 at 1:33 PM, William Adams <***@msn.com>
> >> wrote:
> >> > My code reference comes from here:
> >> > http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
> >> >
> >> > Really what I want is to port the simplex noise functions that I have
> >> > written in C#, but I can't because they require me to use static arrays
> >> > of
> >> > values. That has proven to be very cost prohibitive in OpenScad, so I
> >> > am
> >> > reimplementing using an approach that does not require any storage.
> >> > It's a
> >> > bit slower, but not as slow as the array accesses become over time.
> >> >
> >> > -- William
> >> >
> >> > ===============================
> >> > - Shaping clay is easier than digging it out of the ground.
> >> >
> >> > http://blog.nanotechstyles.com
> >> > http://www.thingiverse.com/WilliamAAdams
> >> > https://github.com/Wiladams
> >> >
> >> >
> >> >
> >> > ________________________________
> >> > From: ***@msn.com
> >> > To: ***@rocklinux.org
> >> > Date: Wed, 26 Oct 2011 18:29:10 +0000
> >> > Subject: Re: [OpenSCAD] boolean logic in openscad
> >> >
> >> > Why yes! In fact, the way I implemented it was:
> >> >
> >> > function LSHIFT(x,pos=1) = x * pow(2,pos);
> >> >
> >> > and opposite for RSHIFT.
> >> >
> >> > Also, sometimes I need '&', sometimes I need '|', and sometimes I need
> >> > '^'
> >> > (xor). And sometimes I need NAND, etc. So, I just implement them as
> >> > simple
> >> > macros.
> >> >
> >> > That way I don't have to remember my powers of 2 whenever I want to use
> >> > them. So, in this case, it turns into:
> >> >
> >> > func(x) = 32BITAND((LSHIFT(x,13)), 2147483648);
> >> >
> >> > That's really easy for my small brain to wrap around, because if I do it
> >> > more than once, it's nice to have it done correctly every time.
> >> >
> >> > It would be nice if the boolean algebra were just there, and hex
> >> > notation
> >> > was supported. I think hex notation is coming, so that will be nice.
> >> >
> >> > -- William
> >> >
> >> > ===============================
> >> > - Shaping clay is easier than digging it out of the ground.
> >> >
> >> > http://blog.nanotechstyles.com
> >> > http://www.thingiverse.com/WilliamAAdams
> >> > https://github.com/Wiladams
> >> >
> >> >
> >> >
> >> > Date: Wed, 26 Oct 2011 19:50:09 +0200
> >> > From: ***@fsfe.org
> >> > To: ***@rocklinux.org
> >> > Subject: Re: [OpenSCAD] boolean logic in openscad
> >> >
> >> > On Wed, Oct 26, 2011 at 01:36:10PM +0000, William Adams wrote:
> >> >> I am wanting to implement a function that has the following pattern
> >> >> func(x) = (x<<13) & 0x7fffffff[...]?
> >> >
> >> > are you aware that this is just the same as func(x) = (x*8192) %
> >> > 2147483648;
> >> > (that is, in more readable but non-openscad notation, x*(2^13) %
> >> > 0x80000000)?
> >> >
> >> > (at least, if you expect x to behave like an integer -- i couldn't
> >> > correlate your sniplet to the source code i found when quickly looking
> >> > it up[1].)
> >> >
> >> > regards
> >> > chrysn
> >> >
> >> > [1] http://mrl.nyu.edu/~perlin/doc/oscar.html#noise
> >> >
> >> > --
> >> > To use raw power is to make yourself infinitely vulnerable to greater
> >> > powers.
> >> > -- Bene Gesserit axiom
> >> >
> >> > _______________________________________________ OpenSCAD mailing list
> >> > ***@rocklinux.org http://rocklinux.net/mailman/listinfo/openscad
> >> > _______________________________________________ OpenSCAD mailing list
> >> > ***@rocklinux.org http://rocklinux.net/mailman/listinfo/openscad
> >> > _______________________________________________
> >> > OpenSCAD mailing list
> >> > ***@rocklinux.org
> >> > http://rocklinux.net/mailman/listinfo/openscad
> >> >
> >> >
> >> _______________________________________________
> >> OpenSCAD mailing list
> >> ***@rocklinux.org
> >> http://rocklinux.net/mailman/listinfo/openscad
> >
> > _______________________________________________
> > OpenSCAD mailing list
> > ***@rocklinux.org
> > http://rocklinux.net/mailman/listinfo/openscad
> >
> >
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
Giles Bathgate
2011-10-27 08:51:22 UTC
Permalink
As always its amazing to see what william adams can do with openscad
despite various limitations. I can't help but wonder however if he
could program these things as C modules rather than OpenSCAD modules.
I personally think it would be better to have a PerlinNoise() module
than various bitwise operators such that someone could roll thier own.
For the end user (except william) its simpler to be able to access a
ready library of high level functions.

Regards

Giles
William Adams
2011-10-27 12:25:17 UTC
Permalink
I agree 110%!! Just like the bezier stuff, height maps, and a number of other things. But, I am humble here. I'm not doing the work. RapCAD has a number of the improvements I'd love to see in OpenScad, for example. In particular how functions have bodies, and arrays can be appended. A general extension mechanism would be fantastic. Like being able to program extensions in Python, or Lua, or Javascript. But, I'm not pushing for anything, because like I said, I'm not doing the work. I do hope that some of the things I implement get picked up and made into actual C modules, but since I'm not going to do the work, I'm not complaining either. I know right now the focus is on getting things stable and speedy, and that's fine by me. -- William

===============================

- Shaping clay is easier than digging it out of the ground.


http://blog.nanotechstyles.com
http://www.thingiverse.com/WilliamAAdams
https://github.com/Wiladams


> Date: Thu, 27 Oct 2011 09:51:22 +0100
> From: ***@gmail.com
> To: ***@rocklinux.org
> Subject: Re: [OpenSCAD] boolean logic in openscad
>
> As always its amazing to see what william adams can do with openscad
> despite various limitations. I can't help but wonder however if he
> could program these things as C modules rather than OpenSCAD modules.
> I personally think it would be better to have a PerlinNoise() module
> than various bitwise operators such that someone could roll thier own.
> For the end user (except william) its simpler to be able to access a
> ready library of high level functions.
>
> Regards
>
> Giles
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
Tony Buser
2011-10-27 05:37:25 UTC
Permalink
It's not that far ahead of it's time... texture mapping and image to
heightmap can be used to interesting effect for things such as
http://www.thingiverse.com/thing:12908 and
http://www.thingiverse.com/thing:12405 :)

Although I do agree, I'd rather see more priority in making OpenSCAD faster
and less crashy.

On Wed, Oct 26, 2011 at 6:57 PM, Don Bright <***@gmail.com> wrote:

> considering STL only outputs one color, this 3d procedural texture stuff
> might
> be a little ahead of its time... (i.e. might be higher priority to stop
> openscad
> from constantly crashing machines)
>
> but i can see it 10 years from now:
>
> color("wood_grain1") sphere(5);
>
> And the color 3d printer spits out a wood-grained sphere. hopefully
> not with your name on it (sorry, cant resist PKD reference)
>
>
William Adams
2011-10-27 12:27:36 UTC
Permalink
Agree 100% on the priorities. It's unfortunate that my original question has taken the turn of being measured against other priorities. Really I just wanted to know if I had missed something. I'm perfectly happy just trundling along with my hacks and extensions. For those who are actually focused on writing the code, stability and speed are certainly higher priorities than this stuff. -- William

===============================

- Shaping clay is easier than digging it out of the ground.


http://blog.nanotechstyles.com
http://www.thingiverse.com/WilliamAAdams
https://github.com/Wiladams


Date: Thu, 27 Oct 2011 01:37:25 -0400
From: ***@gmail.com
To: ***@rocklinux.org
Subject: Re: [OpenSCAD] boolean logic in openscad

It's not that far ahead of it's time... texture mapping and image to heightmap can be used to interesting effect for things such as http://www.thingiverse.com/thing:12908 and http://www.thingiverse.com/thing:12405 :)


Although I do agree, I'd rather see more priority in making OpenSCAD faster and less crashy.

On Wed, Oct 26, 2011 at 6:57 PM, Don Bright <***@gmail.com> wrote:

considering STL only outputs one color, this 3d procedural texture stuff might

be a little ahead of its time... (i.e. might be higher priority to stop openscad

from constantly crashing machines)



but i can see it 10 years from now:



color("wood_grain1") sphere(5);



And the color 3d printer spits out a wood-grained sphere. hopefully

not with your name on it (sorry, cant resist PKD reference)
Don Bright
2011-10-27 23:48:10 UTC
Permalink
didn't mean to trash the idea i just
am not sure if it will get integrated into mainstream release anytime soon

here is my hacked up version, it has 5 bitwise operators. & | ^ << >> ,
or AND OR XOR SHL SHR

https://github.com/downloads/donbright/openscad/notopenscad_setup.exe

it will not overrwrite your openscad, its called 'notopenscad'. i dont know if
it will work with your procedural texture mapping (which i have confused
in my brain with procedural coloring or something.. oops)

i presume you have windows???? if not here is the git branch:
https://github.com/donbright/openscad/tree/crazybits
you can clone as normal, just do 'git checkout crazybits' after clone

anways basically it works by taking the double,
making it an unsigned int, doing the C++ thing ( & | ^ << >> ) and
recasting to double.

any more than that and i run up against the limitation of C++ that its
not 'super easy' to overload operators that are not already
operators,,, see expr.cc

however im guessing there would be some way around that too (just im
kinda sleep derprived..)

-DB



On Thu, Oct 27, 2011 at 7:27 AM, William Adams <***@msn.com> wrote:
> Agree 100% on the priorities.
>
> It's unfortunate that my original question has taken the turn of being
> measured against other priorities.  Really I just wanted to know if I had
> missed something.  I'm perfectly happy just trundling along with my hacks
> and extensions.  For those who are actually focused on writing the code,
> stability and speed are certainly higher priorities than this stuff.
>
> -- William
>
> ===============================
> - Shaping clay is easier than digging it out of the ground.
>
> http://blog.nanotechstyles.com
> http://www.thingiverse.com/WilliamAAdams
> https://github.com/Wiladams
>
>
>
> ________________________________
> Date: Thu, 27 Oct 2011 01:37:25 -0400
> From: ***@gmail.com
> To: ***@rocklinux.org
> Subject: Re: [OpenSCAD] boolean logic in openscad
>
> It's not that far ahead of it's time... texture mapping and image to
> heightmap can be used to interesting effect for things such as
> http://www.thingiverse.com/thing:12908 and
> http://www.thingiverse.com/thing:12405  :)
>
> Although I do agree, I'd rather see more priority in making OpenSCAD faster
> and less crashy.
>
> On Wed, Oct 26, 2011 at 6:57 PM, Don Bright <***@gmail.com> wrote:
>
> considering STL only outputs one color, this 3d procedural texture stuff
> might
> be a little ahead of its time... (i.e. might be higher priority to stop
> openscad
> from constantly crashing machines)
>
> but i can see it 10 years from now:
>
> color("wood_grain1") sphere(5);
>
> And the color 3d printer spits out a wood-grained sphere. hopefully
> not with your name on it (sorry, cant resist PKD reference)
>
>
>
> _______________________________________________ OpenSCAD mailing list
> ***@rocklinux.org http://rocklinux.net/mailman/listinfo/openscad
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
>
Michael Brown
2011-10-24 23:16:19 UTC
Permalink
You can easily download pins.scad from thingiverse, which is where I got it.
Its at http://www.thingiverse.com/thing:10541
--
Michael

On Mon, Oct 24, 2011 at 5:05 PM, Don Bright <***@gmail.com> wrote:

> nevermind. i see it requires a script.
> however the script doesn't work under mingw nor does it work under cygwin
>
>
> On Mon, Oct 24, 2011 at 5:00 PM, Don Bright <***@gmail.com>
> wrote:
> > Sorry, I can't find pins.scad
> >
> >
> > On Mon, Oct 24, 2011 at 12:36 AM, Michael Brown
> > <***@michaels-house.net> wrote:
> >> I am trying out openscad to make a few things, and I've run up against a
> >> brick wall in that my designs are previewing, but wont render or stl
> export
> >> in a 'reasonable' time. I'm using latest openscad git updated yesterday
> on a
> >> Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.
> >> I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V,
> >> (http://www.thingiverse.com/thing:7361
> >> and http://www.thingiverse.com/thing:8928). I'm trying to make a
> container
> >> using the bracelet design as the sides and spiro coaster design for the
> >> lid. I merged the scad programs, and basically rewrote a lot of it, so
> it's
> >> more 'inspired' by at this point, but it all previews nicely and looks
> good.
> >> My problem at this point is that it is taking *forever* to compile, and
> >> using almost 2GB of ram. I'm trying to figure out why it is taking so
> long.
> >> I've uploaded my code to github
> >> (https://github.com/superchalupa/container-round-decorative). Attached
> is
> >> the main module I've developed.
> >> For comparison, I've re-compiled MakeALot's bracelet and it compiles in
> >> about 41 minutes for me. When I redid the same basic bracelet design
> with my
> >> code, it literally took 23 hours. The object is fairly simple, so I am
> at a
> >> loss as to why it takes so long. It is a torus with about 100 oval
> holes. At
> >> first I was specifying $fn variables, but under the assumption that I
> was
> >> over-specifying things, I've removed almost all of those. The second
> thing I
> >> did was that I was using unit circles and scaling, which ends up using
> only
> >> 5 fragments, so I started using larger circles and different scaling
> factors
> >> to let openscad choose a more appropriate number of fragments. This has
> not
> >> seemed to help.
> >> Calling my main module with this:
> >>
> >> // for my 3 year old (small)
> >> radius=23;
> >> bracelet_width=35;
> >> wall_thick=3;
> >> hole_len=8;
> >> distance_between_holes=1;
> >> hole_rotation_angle = 80;
> >> num_divisions_around = 16;
> >> edge_buffer=2;
> >> holy_squished_hollow_torus(bracelet_width,
> >> radius,
> >> wall_thick,
> >> edge_buffer,
> >> hole_len,
> >> distance_between_holes,
> >> hole_rotation_angle,
> >> num_divisions_around);
> >>
> >> Results in this:
> >> time make bracelet.stl
> >> openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename
> bracelet.stl
> >> .stl)\"
> >> Compiling library
> >>
> `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
> >> Compiling library
> >> `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
> >> ECHO: "y_step: ", 8.863269777109872
> >> ECHO: "num big ovals: ", 3
> >> ECHO: "degrees_per_y", 0.4392519091611444
> >> ECHO: "leftover", 11
> >> CGAL Cache insert: group(); (0 verts)
> >> Number of polygons before reduction: 1
> >> ... cut ...
> >> CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
> >> CGAL Cache insert: difference(){group(){difference(){group( (26991
> verts)
> >> CGAL Cache insert: group(){group();group();group();group(); (26991
> verts)
> >> CGAL Cache insert: group(){group(){group();group();group(); (26991
> verts)
> >> real 1415m34.047s
> >> user 1404m59.223s
> >> sys 0m10.050s
> >> --
> >> Michael
> >>
> >>
> >> _______________________________________________
> >> OpenSCAD mailing list
> >> ***@rocklinux.org
> >> http://rocklinux.net/mailman/listinfo/openscad
> >>
> >>
> >
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
Don Bright
2011-10-25 23:10:16 UTC
Permalink
sorry man i dont know if my last message yesterday got through, i got
some error about my image was too big for the email list.

my basic theory (after viewing in 'throwntogether' rendering mode) is
that CGAL was getting gummed up when all those negative cylinders met
at the center. they all touched each other and CGAL was having to slug
through that.


i redid your code, so that instead of being spikes that meet in the
center, they are little stubbies that sit on your ring.

i also used $fn=10

it took 20 minutes to CGAL render on my 2.7ghz pentium 4 with 1GIG of
RAM. I ran 'top' and openscad sat steady at 100-200m of memory, while
maxing out CPU.

hope this helps. ps, i love that shape, its really cool looking.

-DB

difference() {
squished_hollow_torus(radius, minor_radius, box_height, wall_thick);

// Ok, this was a pain to come up with, but basically here we
chop holes in the sides
// outer loop copies each individual vertical 'line' around
the circumference
// inner loop does one individual 'line' of holes going up
for (i=[0:num_divisions_around-1]) {
// first row

for (j=[0:num_big_ovals-1]) {

rotate([0,0,i*(360/num_divisions_around)+j*(degrees_per_y*y_step)])
translate([radius*0.7,0,leftover/2 + y_step/2 + j*y_step])
rotate([hole_rotation_angle,0,0])
rotate([0,90,0])
scale([1.5/oval_maj_rad,1,1])

cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad, r2=oval_maj_rad);
}

// The 'odd' row (starts with half oval, but we skip that
in this loop)

for (j=[0:num_big_ovals-2]) {

rotate([0,0,(i+0.5)*(360/num_divisions_around)+j*(degrees_per_y*y_step)+degrees_per_y*y_step/2])
translate([radius*0.7,0,leftover/2 + y_step + j*y_step])
rotate([hole_rotation_angle,0,0])
rotate([0,90,0])
scale([1.5/oval_maj_rad,1,1])

cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad, r2=oval_maj_rad);
}

// here we get the odd half-sized ones on the bottom
// uses same formula as above, but I simplified couple
terms manually
rotate([0,0,(i+0.5)*(360/num_divisions_around)-degrees_per_y*y_step/4])
translate([radius*0.7,0,leftover/2 + y_step/4])
rotate([hole_rotation_angle,0,0])
rotate([0,90,0])
scale([1.5/oval_maj_rad,1/2,1])
cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad,
r2=oval_maj_rad);

// here we get the odd half-sized ones on the top
// uses same formula as above, but I simplified couple
terms manually

rotate([0,0,(i+0.5)*(360/num_divisions_around)+(num_big_ovals-1)*(degrees_per_y*y_step)+degrees_per_y*y_step/4])
translate([radius*0.7,0,leftover/2 + y_step +
(num_big_ovals-1)*y_step - y_step/4])
rotate([hole_rotation_angle,0,0])
rotate([0,90,0])
scale([1.5/oval_maj_rad,1/2,1])
cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad,
r2=oval_maj_rad);

}


On Mon, Oct 24, 2011 at 12:36 AM, Michael Brown
<***@michaels-house.net> wrote:
> I am trying out openscad to make a few things, and I've run up against a
> brick wall in that my designs are previewing, but wont render or stl export
> in a 'reasonable' time. I'm using latest openscad git updated yesterday on a
> Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.
> I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V,
> (http://www.thingiverse.com/thing:7361
> and http://www.thingiverse.com/thing:8928). I'm trying to make a container
> using the bracelet design as the sides and spiro coaster design for the
> lid. I merged the scad programs, and basically rewrote a lot of it, so it's
> more 'inspired' by at this point, but it all previews nicely and looks good.
> My problem at this point is that it is taking *forever* to compile, and
> using almost 2GB of ram. I'm trying to figure out why it is taking so long.
>  I've uploaded my code to github
> (https://github.com/superchalupa/container-round-decorative). Attached is
> the main module I've developed.
> For comparison, I've re-compiled MakeALot's bracelet and it compiles in
> about 41 minutes for me. When I redid the same basic bracelet design with my
> code, it literally took 23 hours. The object is fairly simple, so I am at a
> loss as to why it takes so long. It is a torus with about 100 oval holes. At
> first I was specifying $fn variables, but under the assumption that I was
> over-specifying things, I've removed almost all of those. The second thing I
> did was that I was using unit circles and scaling, which ends up using only
> 5 fragments, so I started using larger circles and different scaling factors
> to let openscad choose a more appropriate number of fragments. This has not
> seemed to help.
> Calling my main module with this:
>
> // for my 3 year old (small)
> radius=23;
> bracelet_width=35;
> wall_thick=3;
> hole_len=8;
> distance_between_holes=1;
> hole_rotation_angle = 80;
> num_divisions_around = 16;
> edge_buffer=2;
> holy_squished_hollow_torus(bracelet_width,
>                            radius,
>                            wall_thick,
>                            edge_buffer,
>                            hole_len,
>                            distance_between_holes,
>                            hole_rotation_angle,
>                            num_divisions_around);
>
> Results in this:
> time make bracelet.stl
> openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename bracelet.stl
> .stl)\"
> Compiling library
> `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
> Compiling library
> `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
> ECHO: "y_step: ", 8.863269777109872
> ECHO: "num big ovals: ", 3
> ECHO: "degrees_per_y", 0.4392519091611444
> ECHO: "leftover", 11
> CGAL Cache insert: group(); (0 verts)
> Number of polygons before reduction: 1
>     ... cut ...
> CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
> CGAL Cache insert: difference(){group(){difference(){group( (26991 verts)
> CGAL Cache insert: group(){group();group();group();group(); (26991 verts)
> CGAL Cache insert: group(){group(){group();group();group(); (26991 verts)
> real 1415m34.047s
> user 1404m59.223s
> sys 0m10.050s
> --
> Michael
>
>
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
>
Michael Brown
2011-10-26 03:15:20 UTC
Permalink
Thanks, I will check this out!

And credit for the shape goes to MakeALot, I basically stole the design from
him and just made it parametric.
--
Michael

On Tue, Oct 25, 2011 at 6:10 PM, Don Bright <***@gmail.com> wrote:

> sorry man i dont know if my last message yesterday got through, i got
> some error about my image was too big for the email list.
>
> my basic theory (after viewing in 'throwntogether' rendering mode) is
> that CGAL was getting gummed up when all those negative cylinders met
> at the center. they all touched each other and CGAL was having to slug
> through that.
>
>
> i redid your code, so that instead of being spikes that meet in the
> center, they are little stubbies that sit on your ring.
>
> i also used $fn=10
>
> it took 20 minutes to CGAL render on my 2.7ghz pentium 4 with 1GIG of
> RAM. I ran 'top' and openscad sat steady at 100-200m of memory, while
> maxing out CPU.
>
> hope this helps. ps, i love that shape, its really cool looking.
>
> -DB
>
> difference() {
> squished_hollow_torus(radius, minor_radius, box_height, wall_thick);
>
> // Ok, this was a pain to come up with, but basically here we
> chop holes in the sides
> // outer loop copies each individual vertical 'line' around
> the circumference
> // inner loop does one individual 'line' of holes going up
> for (i=[0:num_divisions_around-1]) {
> // first row
>
> for (j=[0:num_big_ovals-1]) {
>
> rotate([0,0,i*(360/num_divisions_around)+j*(degrees_per_y*y_step)])
> translate([radius*0.7,0,leftover/2 + y_step/2 +
> j*y_step])
> rotate([hole_rotation_angle,0,0])
> rotate([0,90,0])
> scale([1.5/oval_maj_rad,1,1])
>
> cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad, r2=oval_maj_rad);
> }
>
> // The 'odd' row (starts with half oval, but we skip that
> in this loop)
>
> for (j=[0:num_big_ovals-2]) {
>
>
> rotate([0,0,(i+0.5)*(360/num_divisions_around)+j*(degrees_per_y*y_step)+degrees_per_y*y_step/2])
> translate([radius*0.7,0,leftover/2 + y_step + j*y_step])
> rotate([hole_rotation_angle,0,0])
> rotate([0,90,0])
> scale([1.5/oval_maj_rad,1,1])
>
> cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad, r2=oval_maj_rad);
> }
>
> // here we get the odd half-sized ones on the bottom
> // uses same formula as above, but I simplified couple
> terms manually
>
> rotate([0,0,(i+0.5)*(360/num_divisions_around)-degrees_per_y*y_step/4])
> translate([radius*0.7,0,leftover/2 + y_step/4])
> rotate([hole_rotation_angle,0,0])
> rotate([0,90,0])
> scale([1.5/oval_maj_rad,1/2,1])
> cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad,
> r2=oval_maj_rad);
>
> // here we get the odd half-sized ones on the top
> // uses same formula as above, but I simplified couple
> terms manually
>
>
> rotate([0,0,(i+0.5)*(360/num_divisions_around)+(num_big_ovals-1)*(degrees_per_y*y_step)+degrees_per_y*y_step/4])
> translate([radius*0.7,0,leftover/2 + y_step +
> (num_big_ovals-1)*y_step - y_step/4])
> rotate([hole_rotation_angle,0,0])
> rotate([0,90,0])
> scale([1.5/oval_maj_rad,1/2,1])
> cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad,
> r2=oval_maj_rad);
>
> }
>
>
> On Mon, Oct 24, 2011 at 12:36 AM, Michael Brown
> <***@michaels-house.net> wrote:
> > I am trying out openscad to make a few things, and I've run up against a
> > brick wall in that my designs are previewing, but wont render or stl
> export
> > in a 'reasonable' time. I'm using latest openscad git updated yesterday
> on a
> > Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.
> > I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V,
> > (http://www.thingiverse.com/thing:7361
> > and http://www.thingiverse.com/thing:8928). I'm trying to make a
> container
> > using the bracelet design as the sides and spiro coaster design for the
> > lid. I merged the scad programs, and basically rewrote a lot of it, so
> it's
> > more 'inspired' by at this point, but it all previews nicely and looks
> good.
> > My problem at this point is that it is taking *forever* to compile, and
> > using almost 2GB of ram. I'm trying to figure out why it is taking so
> long.
> > I've uploaded my code to github
> > (https://github.com/superchalupa/container-round-decorative). Attached
> is
> > the main module I've developed.
> > For comparison, I've re-compiled MakeALot's bracelet and it compiles in
> > about 41 minutes for me. When I redid the same basic bracelet design with
> my
> > code, it literally took 23 hours. The object is fairly simple, so I am at
> a
> > loss as to why it takes so long. It is a torus with about 100 oval holes.
> At
> > first I was specifying $fn variables, but under the assumption that I was
> > over-specifying things, I've removed almost all of those. The second
> thing I
> > did was that I was using unit circles and scaling, which ends up using
> only
> > 5 fragments, so I started using larger circles and different scaling
> factors
> > to let openscad choose a more appropriate number of fragments. This has
> not
> > seemed to help.
> > Calling my main module with this:
> >
> > // for my 3 year old (small)
> > radius=23;
> > bracelet_width=35;
> > wall_thick=3;
> > hole_len=8;
> > distance_between_holes=1;
> > hole_rotation_angle = 80;
> > num_divisions_around = 16;
> > edge_buffer=2;
> > holy_squished_hollow_torus(bracelet_width,
> > radius,
> > wall_thick,
> > edge_buffer,
> > hole_len,
> > distance_between_holes,
> > hole_rotation_angle,
> > num_divisions_around);
> >
> > Results in this:
> > time make bracelet.stl
> > openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename bracelet.stl
> > .stl)\"
> > Compiling library
> >
> `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
> > Compiling library
> > `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
> > ECHO: "y_step: ", 8.863269777109872
> > ECHO: "num big ovals: ", 3
> > ECHO: "degrees_per_y", 0.4392519091611444
> > ECHO: "leftover", 11
> > CGAL Cache insert: group(); (0 verts)
> > Number of polygons before reduction: 1
> > ... cut ...
> > CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
> > CGAL Cache insert: difference(){group(){difference(){group( (26991 verts)
> > CGAL Cache insert: group(){group();group();group();group(); (26991 verts)
> > CGAL Cache insert: group(){group(){group();group();group(); (26991 verts)
> > real 1415m34.047s
> > user 1404m59.223s
> > sys 0m10.050s
> > --
> > Michael
> >
> >
> > _______________________________________________
> > OpenSCAD mailing list
> > ***@rocklinux.org
> > http://rocklinux.net/mailman/listinfo/openscad
> >
> >
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
Michael Brown
2011-10-26 07:52:50 UTC
Permalink
Some of the speed issues seem to be resolved with this plus one other small
bug I fixed.

Unfortunately, I'm still running into assertion errors and/or crashes. In
fact, now I've got a situation where if I even start up the GUI, it quickly
takes up literally all my memory, OOMs the machine, and gets killed (or
crashes the box).

I've been attempting to comment out one thing at a time in the model to get
to a working state
--
Michael

On Tue, Oct 25, 2011 at 6:10 PM, Don Bright <***@gmail.com> wrote:

> sorry man i dont know if my last message yesterday got through, i got
> some error about my image was too big for the email list.
>
> my basic theory (after viewing in 'throwntogether' rendering mode) is
> that CGAL was getting gummed up when all those negative cylinders met
> at the center. they all touched each other and CGAL was having to slug
> through that.
>
>
> i redid your code, so that instead of being spikes that meet in the
> center, they are little stubbies that sit on your ring.
>
> i also used $fn=10
>
> it took 20 minutes to CGAL render on my 2.7ghz pentium 4 with 1GIG of
> RAM. I ran 'top' and openscad sat steady at 100-200m of memory, while
> maxing out CPU.
>
> hope this helps. ps, i love that shape, its really cool looking.
>
> -DB
>
> difference() {
> squished_hollow_torus(radius, minor_radius, box_height, wall_thick);
>
> // Ok, this was a pain to come up with, but basically here we
> chop holes in the sides
> // outer loop copies each individual vertical 'line' around
> the circumference
> // inner loop does one individual 'line' of holes going up
> for (i=[0:num_divisions_around-1]) {
> // first row
>
> for (j=[0:num_big_ovals-1]) {
>
> rotate([0,0,i*(360/num_divisions_around)+j*(degrees_per_y*y_step)])
> translate([radius*0.7,0,leftover/2 + y_step/2 +
> j*y_step])
> rotate([hole_rotation_angle,0,0])
> rotate([0,90,0])
> scale([1.5/oval_maj_rad,1,1])
>
> cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad, r2=oval_maj_rad);
> }
>
> // The 'odd' row (starts with half oval, but we skip that
> in this loop)
>
> for (j=[0:num_big_ovals-2]) {
>
>
> rotate([0,0,(i+0.5)*(360/num_divisions_around)+j*(degrees_per_y*y_step)+degrees_per_y*y_step/2])
> translate([radius*0.7,0,leftover/2 + y_step + j*y_step])
> rotate([hole_rotation_angle,0,0])
> rotate([0,90,0])
> scale([1.5/oval_maj_rad,1,1])
>
> cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad, r2=oval_maj_rad);
> }
>
> // here we get the odd half-sized ones on the bottom
> // uses same formula as above, but I simplified couple
> terms manually
>
> rotate([0,0,(i+0.5)*(360/num_divisions_around)-degrees_per_y*y_step/4])
> translate([radius*0.7,0,leftover/2 + y_step/4])
> rotate([hole_rotation_angle,0,0])
> rotate([0,90,0])
> scale([1.5/oval_maj_rad,1/2,1])
> cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad,
> r2=oval_maj_rad);
>
> // here we get the odd half-sized ones on the top
> // uses same formula as above, but I simplified couple
> terms manually
>
>
> rotate([0,0,(i+0.5)*(360/num_divisions_around)+(num_big_ovals-1)*(degrees_per_y*y_step)+degrees_per_y*y_step/4])
> translate([radius*0.7,0,leftover/2 + y_step +
> (num_big_ovals-1)*y_step - y_step/4])
> rotate([hole_rotation_angle,0,0])
> rotate([0,90,0])
> scale([1.5/oval_maj_rad,1/2,1])
> cylinder(h=wall_thick*4+smidgen,r1=oval_maj_rad,
> r2=oval_maj_rad);
>
> }
>
>
> On Mon, Oct 24, 2011 at 12:36 AM, Michael Brown
> <***@michaels-house.net> wrote:
> > I am trying out openscad to make a few things, and I've run up against a
> > brick wall in that my designs are previewing, but wont render or stl
> export
> > in a 'reasonable' time. I'm using latest openscad git updated yesterday
> on a
> > Fedora 15 Linux system running quad-core AMD Phenom @3.2Ghz.
> > I thought I'd make a mashup of MakeALot's Spiro Coaster and Bracelet V,
> > (http://www.thingiverse.com/thing:7361
> > and http://www.thingiverse.com/thing:8928). I'm trying to make a
> container
> > using the bracelet design as the sides and spiro coaster design for the
> > lid. I merged the scad programs, and basically rewrote a lot of it, so
> it's
> > more 'inspired' by at this point, but it all previews nicely and looks
> good.
> > My problem at this point is that it is taking *forever* to compile, and
> > using almost 2GB of ram. I'm trying to figure out why it is taking so
> long.
> > I've uploaded my code to github
> > (https://github.com/superchalupa/container-round-decorative). Attached
> is
> > the main module I've developed.
> > For comparison, I've re-compiled MakeALot's bracelet and it compiles in
> > about 41 minutes for me. When I redid the same basic bracelet design with
> my
> > code, it literally took 23 hours. The object is fairly simple, so I am at
> a
> > loss as to why it takes so long. It is a torus with about 100 oval holes.
> At
> > first I was specifying $fn variables, but under the assumption that I was
> > over-specifying things, I've removed almost all of those. The second
> thing I
> > did was that I was using unit circles and scaling, which ends up using
> only
> > 5 fragments, so I started using larger circles and different scaling
> factors
> > to let openscad choose a more appropriate number of fragments. This has
> not
> > seemed to help.
> > Calling my main module with this:
> >
> > // for my 3 year old (small)
> > radius=23;
> > bracelet_width=35;
> > wall_thick=3;
> > hole_len=8;
> > distance_between_holes=1;
> > hole_rotation_angle = 80;
> > num_divisions_around = 16;
> > edge_buffer=2;
> > holy_squished_hollow_torus(bracelet_width,
> > radius,
> > wall_thick,
> > edge_buffer,
> > hole_len,
> > distance_between_holes,
> > hole_rotation_angle,
> > num_divisions_around);
> >
> > Results in this:
> > time make bracelet.stl
> > openscad -o bracelet.stl bracelet.scad -Dlayout=\"$(basename bracelet.stl
> > .stl)\"
> > Compiling library
> >
> `/home/michael_e_brown/thingomatic/things/my-designs/box/container_module.scad'.
> > Compiling library
> > `/home/michael_e_brown/thingomatic/things/my-designs/box/pins.scad'.
> > ECHO: "y_step: ", 8.863269777109872
> > ECHO: "num big ovals: ", 3
> > ECHO: "degrees_per_y", 0.4392519091611444
> > ECHO: "leftover", 11
> > CGAL Cache insert: group(); (0 verts)
> > Number of polygons before reduction: 1
> > ... cut ...
> > CGAL Cache insert: group(){group(){multmatrix([[1,0,0,0],[0 (3340 verts)
> > CGAL Cache insert: difference(){group(){difference(){group( (26991 verts)
> > CGAL Cache insert: group(){group();group();group();group(); (26991 verts)
> > CGAL Cache insert: group(){group(){group();group();group(); (26991 verts)
> > real 1415m34.047s
> > user 1404m59.223s
> > sys 0m10.050s
> > --
> > Michael
> >
> >
> > _______________________________________________
> > OpenSCAD mailing list
> > ***@rocklinux.org
> > http://rocklinux.net/mailman/listinfo/openscad
> >
> >
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
Marius Kintel
2011-10-26 22:50:49 UTC
Permalink
On Oct 26, 2011, at 09:52 AM, Michael Brown wrote:

> Unfortunately, I'm still running into assertion errors and/or crashes.

I've fixed the assertion error. It was a bug in the caching code which was introduced in September.

-Marius
Michael Brown
2011-10-27 02:31:40 UTC
Permalink
Ok, two things:

1) The assertion error is gone! I can call openscad from the command line to
build my stl files.

2) When I try to open up my scad files in openscad gui mode, it
*immediately* (within about 5 seconds) consumes all available RAM and gets
killed by the OOM killer.

I have tagged the offending code: openscad-memleak

git clone git://github.com/superchalupa/container-round-decorative.git
cd container-round-decorative
git checkout openscad-memleak
openscad ./box.scad

I suggest having 'top' running and kill it when you see it get above a
couple gigs, or you risk crashing your machine (I've already done that a
couple times now).

I tried wrapping the toplevel object with render(), but that didnt help.

--
Michael

On Wed, Oct 26, 2011 at 5:50 PM, Marius Kintel <***@kintel.net> wrote:

> On Oct 26, 2011, at 09:52 AM, Michael Brown wrote:
>
> > Unfortunately, I'm still running into assertion errors and/or crashes.
>
> I've fixed the assertion error. It was a bug in the caching code which was
> introduced in September.
>
> -Marius
>
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
Don Bright
2011-10-27 03:03:14 UTC
Permalink
branch openscad-memleak doesnt appear to be uploaded to github


On Wed, Oct 26, 2011 at 9:31 PM, Michael Brown
<***@michaels-house.net> wrote:
> Ok, two things:
> 1) The assertion error is gone! I can call openscad from the command line to
> build my stl files.
> 2) When I try to open up my scad files in openscad gui mode, it
> *immediately* (within about 5 seconds) consumes all available RAM and gets
> killed by the OOM killer.
> I have tagged the offending code: openscad-memleak
> git clone  git://github.com/superchalupa/container-round-decorative.git
> cd container-round-decorative
> git checkout openscad-memleak
> openscad ./box.scad
> I suggest having 'top' running and kill it when you see it get above a
> couple gigs, or you risk crashing your machine (I've already done that a
> couple times now).
> I tried wrapping the toplevel object with render(), but that didnt help.
> --
> Michael
>
> On Wed, Oct 26, 2011 at 5:50 PM, Marius Kintel <***@kintel.net> wrote:
>>
>> On Oct 26, 2011, at 09:52 AM, Michael Brown wrote:
>>
>> > Unfortunately, I'm still running into assertion errors and/or crashes.
>>
>> I've fixed the assertion error. It was a bug in the caching code which was
>> introduced in September.
>>
>>  -Marius
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> ***@rocklinux.org
>> http://rocklinux.net/mailman/listinfo/openscad
>
>
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
>
Don Bright
2011-10-27 03:53:50 UTC
Permalink
i have similar problems.

i was able to debug the scad file a little bit by commenting out a
bunch of 'difference()' lines, reducing $fn to 10, and increasing all
of your basic parameters by a factor of 10 (i.e. box_height=700
instead of 70..... sometimes the drawing code crashes on small decimal
differences that dont exist when you deal with larger numbers. )

anyways, when i add the diff() back in it freezes as described.
running git openscad.

i also run
nice -n 19 ionice -c 3 openscad
so i am able to kill it without having to hard-reset my machine.

-DB

On Wed, Oct 26, 2011 at 10:03 PM, Don Bright <***@gmail.com> wrote:
> branch openscad-memleak doesnt appear to be uploaded to github
>
>
> On Wed, Oct 26, 2011 at 9:31 PM, Michael Brown
> <***@michaels-house.net> wrote:
>> Ok, two things:
>> 1) The assertion error is gone! I can call openscad from the command line to
>> build my stl files.
>> 2) When I try to open up my scad files in openscad gui mode, it
>> *immediately* (within about 5 seconds) consumes all available RAM and gets
>> killed by the OOM killer.
>> I have tagged the offending code: openscad-memleak
>> git clone  git://github.com/superchalupa/container-round-decorative.git
>> cd container-round-decorative
>> git checkout openscad-memleak
>> openscad ./box.scad
>> I suggest having 'top' running and kill it when you see it get above a
>> couple gigs, or you risk crashing your machine (I've already done that a
>> couple times now).
>> I tried wrapping the toplevel object with render(), but that didnt help.
>> --
>> Michael
>>
>> On Wed, Oct 26, 2011 at 5:50 PM, Marius Kintel <***@kintel.net> wrote:
>>>
>>> On Oct 26, 2011, at 09:52 AM, Michael Brown wrote:
>>>
>>> > Unfortunately, I'm still running into assertion errors and/or crashes.
>>>
>>> I've fixed the assertion error. It was a bug in the caching code which was
>>> introduced in September.
>>>
>>>  -Marius
>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> ***@rocklinux.org
>>> http://rocklinux.net/mailman/listinfo/openscad
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> ***@rocklinux.org
>> http://rocklinux.net/mailman/listinfo/openscad
>>
>>
>
Michael Brown
2011-10-27 05:14:22 UTC
Permalink
I did get it to render without crashing, finally, by adding render() to the
front of the toplevel object, but that's not exactly a good solution as it
takes about 15 minutes to render.

So, is there a bug in openscad that can be fixed?

Regarding "small decimal differences", I tried to make sure that everything
(as far as I am able to tell) is at least .1 away from anything else.
--
Michael

On Wed, Oct 26, 2011 at 10:53 PM, Don Bright <***@gmail.com>wrote:

> i have similar problems.
>
> i was able to debug the scad file a little bit by commenting out a
> bunch of 'difference()' lines, reducing $fn to 10, and increasing all
> of your basic parameters by a factor of 10 (i.e. box_height=700
> instead of 70..... sometimes the drawing code crashes on small decimal
> differences that dont exist when you deal with larger numbers. )
>
> anyways, when i add the diff() back in it freezes as described.
> running git openscad.
>
> i also run
> nice -n 19 ionice -c 3 openscad
> so i am able to kill it without having to hard-reset my machine.
>
> -DB
>
> On Wed, Oct 26, 2011 at 10:03 PM, Don Bright <***@gmail.com>
> wrote:
> > branch openscad-memleak doesnt appear to be uploaded to github
> >
> >
> > On Wed, Oct 26, 2011 at 9:31 PM, Michael Brown
> > <***@michaels-house.net> wrote:
> >> Ok, two things:
> >> 1) The assertion error is gone! I can call openscad from the command
> line to
> >> build my stl files.
> >> 2) When I try to open up my scad files in openscad gui mode, it
> >> *immediately* (within about 5 seconds) consumes all available RAM and
> gets
> >> killed by the OOM killer.
> >> I have tagged the offending code: openscad-memleak
> >> git clone git://github.com/superchalupa/container-round-decorative.git
> >> cd container-round-decorative
> >> git checkout openscad-memleak
> >> openscad ./box.scad
> >> I suggest having 'top' running and kill it when you see it get above a
> >> couple gigs, or you risk crashing your machine (I've already done that a
> >> couple times now).
> >> I tried wrapping the toplevel object with render(), but that didnt help.
> >> --
> >> Michael
> >>
> >> On Wed, Oct 26, 2011 at 5:50 PM, Marius Kintel <***@kintel.net>
> wrote:
> >>>
> >>> On Oct 26, 2011, at 09:52 AM, Michael Brown wrote:
> >>>
> >>> > Unfortunately, I'm still running into assertion errors and/or
> crashes.
> >>>
> >>> I've fixed the assertion error. It was a bug in the caching code which
> was
> >>> introduced in September.
> >>>
> >>> -Marius
> >>>
> >>> _______________________________________________
> >>> OpenSCAD mailing list
> >>> ***@rocklinux.org
> >>> http://rocklinux.net/mailman/listinfo/openscad
> >>
> >>
> >> _______________________________________________
> >> OpenSCAD mailing list
> >> ***@rocklinux.org
> >> http://rocklinux.net/mailman/listinfo/openscad
> >>
> >>
> >
> _______________________________________________
> OpenSCAD mailing list
> ***@rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
Michael Brown
2011-10-28 04:58:58 UTC
Permalink
I finally figured out what was causing the incredible memory fail.

I had a cube sitting on the XY plane being differenced with a torus that was
tangent to the XY plane. That seemed to intermittently cause the problem.
When I translated the torus down 0.1, everything works reliably now.
--
Michael

On Thu, Oct 27, 2011 at 12:14 AM, Michael Brown
<***@michaels-house.net>wrote:

> I did get it to render without crashing, finally, by adding render() to the
> front of the toplevel object, but that's not exactly a good solution as it
> takes about 15 minutes to render.
>
> So, is there a bug in openscad that can be fixed?
>
> Regarding "small decimal differences", I tried to make sure that everything
> (as far as I am able to tell) is at least .1 away from anything else.
> --
> Michael
>
>
> On Wed, Oct 26, 2011 at 10:53 PM, Don Bright <***@gmail.com>wrote:
>
>> i have similar problems.
>>
>> i was able to debug the scad file a little bit by commenting out a
>> bunch of 'difference()' lines, reducing $fn to 10, and increasing all
>> of your basic parameters by a factor of 10 (i.e. box_height=700
>> instead of 70..... sometimes the drawing code crashes on small decimal
>> differences that dont exist when you deal with larger numbers. )
>>
>> anyways, when i add the diff() back in it freezes as described.
>> running git openscad.
>>
>> i also run
>> nice -n 19 ionice -c 3 openscad
>> so i am able to kill it without having to hard-reset my machine.
>>
>> -DB
>>
>> On Wed, Oct 26, 2011 at 10:03 PM, Don Bright <***@gmail.com>
>> wrote:
>> > branch openscad-memleak doesnt appear to be uploaded to github
>> >
>> >
>> > On Wed, Oct 26, 2011 at 9:31 PM, Michael Brown
>> > <***@michaels-house.net> wrote:
>> >> Ok, two things:
>> >> 1) The assertion error is gone! I can call openscad from the command
>> line to
>> >> build my stl files.
>> >> 2) When I try to open up my scad files in openscad gui mode, it
>> >> *immediately* (within about 5 seconds) consumes all available RAM and
>> gets
>> >> killed by the OOM killer.
>> >> I have tagged the offending code: openscad-memleak
>> >> git clone git://
>> github.com/superchalupa/container-round-decorative.git
>> >> cd container-round-decorative
>> >> git checkout openscad-memleak
>> >> openscad ./box.scad
>> >> I suggest having 'top' running and kill it when you see it get above a
>> >> couple gigs, or you risk crashing your machine (I've already done that
>> a
>> >> couple times now).
>> >> I tried wrapping the toplevel object with render(), but that didnt
>> help.
>> >> --
>> >> Michael
>> >>
>> >> On Wed, Oct 26, 2011 at 5:50 PM, Marius Kintel <***@kintel.net>
>> wrote:
>> >>>
>> >>> On Oct 26, 2011, at 09:52 AM, Michael Brown wrote:
>> >>>
>> >>> > Unfortunately, I'm still running into assertion errors and/or
>> crashes.
>> >>>
>> >>> I've fixed the assertion error. It was a bug in the caching code which
>> was
>> >>> introduced in September.
>> >>>
>> >>> -Marius
>> >>>
>> >>> _______________________________________________
>> >>> OpenSCAD mailing list
>> >>> ***@rocklinux.org
>> >>> http://rocklinux.net/mailman/listinfo/openscad
>> >>
>> >>
>> >> _______________________________________________
>> >> OpenSCAD mailing list
>> >> ***@rocklinux.org
>> >> http://rocklinux.net/mailman/listinfo/openscad
>> >>
>> >>
>> >
>> _______________________________________________
>> OpenSCAD mailing list
>> ***@rocklinux.org
>> http://rocklinux.net/mailman/listinfo/openscad
>>
>
>
Continue reading on narkive:
Loading...