I realize that this code is long, but when I try to make it simpler, the
bug fails to occur.
The bug is that if the for() at the end is [0:0], it works, but [0:1]
blows up with the following (and OpenSCAD is dead and has to be
restarted). Seems simple enough. Making one works, making two is
fatal. I'm sure the problem is simple, but not to me, at the moment.
Thanks
Jon
Parsing design (AST generation)...
Used file cache size: 1 files
Compiling design (CSG Tree generation)...
ECHO: 23.25
Compiling design (CSG Products generation)...
Geometries in cache: 2
Geometry cache size in bytes: 26408
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
WARNING: Normalized tree is growing past 200000 elements. Aborting
normalization.
Execution aborted
include <BOSL2/std.scad>
eps = 0.01;
$fa = 3;
$fs = 0.2;
inches = 25.4;
slop = 0.3; // printing slop
hth = 6.88; // thickness along curve horizontal thickness
vth = 4.83; // actual vertical thickness
ll = 21.25; // link length
// angles and diameters for rotation that creates the curved shape
id = 18.07;
od = id + hth;
ad = (id + od) / 2; // average diameter
an = round(asin(ll/ad))/2; // angle corresponding to "ll"
aSp = 12; // space between axels
xSp = ll + 2.0; // spacing of links
echo(xSp);
pd = 2.62 + slop; // pin diameter
// clearance around axle: I used 0.7, but metal printing needs 1.5
fmp = 0.0; // more clearance For Metal Printing (0.8)
clrc = 0.0; // clearance for clasp
clra = 0.0; // clearance for axles
module LinkShape()
// hull() rotated cylinders to make curved shape
for (a = [-an/2:1:an/2])
rotate([0, 0, a])
translate([ad, 0, 0])
cylinder(h = vth, d = hth);
*LinkShape();
module AxelHoles(sc) {
// "sc" allows cylinder diameter to be scaled for holes vs pins
aa = 0.40 * an; // axle hole angles
for (a = [-aa, aa])
rotate([0, 0, a])
translate([ad, 0, -eps])
cylinder(h = vth + 2eps, d = pdsc);
}
module Link(cutHoles)
rotate([0, -90, 90])
// Y
translate([-ad, 0, 0]) {
difference() {
LinkShape();
if (cutHoles)
AxelHoles(1);
}
}
*Link(true);
module PinAlignmentJig() {
difference() {
* translate([-12.5, -7.5, 0])
cube([25, 15, 2vth+1]);
// link shape
translate([0, 0, 2vth - eps])
scale([1.2, 1.4, 2.0])
rotate([90, 0, 0])
Link(false);
// the bottom link
translate([0, 0, vth - eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// the top link
translate([0, 0, 2*vth + 1 + eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// holes
translate([0, 21.51, -2])
rotate([0, 0, -90])
scale([1, 1, 9])
AxelHoles(1);
}
}
*PinAlignmentJig();
module PinAlignmentJigs() {
for (i = [0:1])
translate([0, i*20, 0])
PinAlignmentJig();
}
!PinAlignmentJigs();
--
This email has been checked for viruses by AVG antivirus software.
www.avg.com
Just set a higher limit in preferences.
On Tue, 20 Jan 2026 at 21:15, Jon Bondy via Discuss <
discuss@lists.openscad.org> wrote:
I realize that this code is long, but when I try to make it simpler, the
bug fails to occur.
The bug is that if the for() at the end is [0:0], it works, but [0:1]
blows up with the following (and OpenSCAD is dead and has to be
restarted). Seems simple enough. Making one works, making two is fatal.
I'm sure the problem is simple, but not to me, at the moment.
Thanks
Jon
Parsing design (AST generation)...
Used file cache size: 1 files
Compiling design (CSG Tree generation)...
ECHO: 23.25
Compiling design (CSG Products generation)...
Geometries in cache: 2
Geometry cache size in bytes: 26408
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
WARNING: Normalized tree is growing past 200000 elements. Aborting
normalization.
Execution aborted
include <BOSL2/std.scad>
eps = 0.01;
$fa = 3;
$fs = 0.2;
inches = 25.4;
slop = 0.3; // printing slop
hth = 6.88; // thickness along curve horizontal thickness
vth = 4.83; // actual vertical thickness
ll = 21.25; // link length
// angles and diameters for rotation that creates the curved shape
id = 18.07;
od = id + hth;
ad = (id + od) / 2; // average diameter
an = round(asin(ll/ad))/2; // angle corresponding to "ll"
aSp = 12; // space between axels
xSp = ll + 2.0; // spacing of links
echo(xSp);
pd = 2.62 + slop; // pin diameter
// clearance around axle: I used 0.7, but metal printing needs 1.5
fmp = 0.0; // more clearance For Metal Printing (0.8)
clrc = 0.0; // clearance for clasp
clra = 0.0; // clearance for axles
module LinkShape()
// hull() rotated cylinders to make curved shape
for (a = [-an/2:1:an/2])
rotate([0, 0, a])
translate([ad, 0, 0])
cylinder(h = vth, d = hth);
*LinkShape();
module AxelHoles(sc) {
// "sc" allows cylinder diameter to be scaled for holes vs pins
aa = 0.40 * an; // axle hole angles
for (a = [-aa, aa])
rotate([0, 0, a])
translate([ad, 0, -eps])
cylinder(h = vth + 2eps, d = pdsc);
}
module Link(cutHoles)
rotate([0, -90, 90])
// Y
translate([-ad, 0, 0]) {
difference() {
LinkShape();
if (cutHoles)
AxelHoles(1);
}
}
*Link(true);
module PinAlignmentJig() {
difference() {
translate([-12.5, -7.5, 0])
cube([25, 15, 2*vth+1]);
// link shape
translate([0, 0, 2*vth - eps])
scale([1.2, 1.4, 2.0])
rotate([90, 0, 0])
Link(false);
// the bottom link
translate([0, 0, vth - eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// the top link
translate([0, 0, 2*vth + 1 + eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// holes
translate([0, 21.51, -2])
rotate([0, 0, -90])
scale([1, 1, 9])
AxelHoles(1);
}
}
module PinAlignmentJigs() {
for (i = [0:1])
translate([0, i*20, 0])
PinAlignmentJig();
}
!PinAlignmentJigs();
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient
Virus-free.www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient
<#m_4427835302210338701_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
nop head:
Thanks.
This is what happens for [0:0]:
Parsing design (AST generation)...
Saved backup file:
C:/Users/jon/OneDrive/Documents/OpenSCAD/backups/test-backup-loVopDsc.scad
Used file cache size: 1 files
Compiling design (CSG Tree generation)...
ECHO: 23.25
Compiling design (CSG Products generation)...
Geometries in cache: 2
Geometry cache size in bytes: 26408
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
Normalized tree has 2686 elements!
Compile and preview finished.
Total rendering time: 0:00:00.487
So, 26K in geometry cache and 2.5K elements for one object.
Then everything explodes for 2 objects?!?
And OpenSCAD dies?!?
This seems very extreme for a minor change in geometry.
I hope others chime in.
Jon
On 1/20/2026 4:23 PM, nop head via Discuss wrote:
Just set a higher limit in preferences.
On Tue, 20 Jan 2026 at 21:15, Jon Bondy via Discuss
discuss@lists.openscad.org wrote:
I realize that this code is long, but when I try to make it
simpler, the bug fails to occur.
The bug is that if the for() at the end is [0:0], it works, but
[0:1] blows up with the following (and OpenSCAD is dead and has to
be restarted). Seems simple enough. Making one works, making two
is fatal. I'm sure the problem is simple, but not to me, at the
moment.
Thanks
Jon
Parsing design (AST generation)...
Used file cache size: 1 files
Compiling design (CSG Tree generation)...
ECHO: 23.25
Compiling design (CSG Products generation)...
Geometries in cache: 2
Geometry cache size in bytes: 26408
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
WARNING: Normalized tree is growing past 200000 elements. Aborting
normalization.
Execution aborted
include <BOSL2/std.scad>
eps = 0.01;
$fa = 3;
$fs = 0.2;
inches = 25.4;
slop = 0.3; // printing slop
hth = 6.88; // thickness along curve horizontal
thickness
vth = 4.83; // actual vertical thickness
ll = 21.25; // link length
// angles and diameters for rotation that creates the curved shape
id = 18.07;
od = id + hth;
ad = (id + od) / 2; // average diameter
an = round(asin(ll/ad))/2; // angle corresponding to "ll"
aSp = 12; // space between axels
xSp = ll + 2.0; // spacing of links
echo(xSp);
pd = 2.62 + slop; // pin diameter
// clearance around axle: I used 0.7, but metal printing needs 1.5
fmp = 0.0; // more clearance For Metal Printing (0.8)
clrc = 0.0; // clearance for clasp
clra = 0.0; // clearance for axles
module LinkShape()
// hull() rotated cylinders to make curved shape
for (a = [-an/2:1:an/2])
rotate([0, 0, a])
translate([ad, 0, 0])
cylinder(h = vth, d = hth);
*LinkShape();
module AxelHoles(sc) {
// "sc" allows cylinder diameter to be scaled for holes vs pins
aa = 0.40 * an; // axle hole angles
for (a = [-aa, aa])
rotate([0, 0, a])
translate([ad, 0, -eps])
cylinder(h = vth + 2*eps, d = pd*sc);
}
module Link(cutHoles)
rotate([0, -90, 90])
// Y
translate([-ad, 0, 0]) {
difference() {
LinkShape();
if (cutHoles)
AxelHoles(1);
}
}
*Link(true);
module PinAlignmentJig() {
difference() {
* translate([-12.5, -7.5, 0])
cube([25, 15, 2*vth+1]);
// link shape
translate([0, 0, 2*vth - eps])
scale([1.2, 1.4, 2.0])
rotate([90, 0, 0])
Link(false);
// the bottom link
translate([0, 0, vth - eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// the top link
translate([0, 0, 2*vth + 1 + eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// holes
translate([0, 21.51, -2])
rotate([0, 0, -90])
scale([1, 1, 9])
AxelHoles(1);
}
}
*PinAlignmentJig();
module PinAlignmentJigs() {
for (i = [0:1])
translate([0, i*20, 0])
PinAlignmentJig();
}
!PinAlignmentJigs();
<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=_1-rs70Ezxd5n-QRSTN5nB8DXCZZYTQHdfCPns8dtgjb0FGu-e7_61qDa4Gwecmw&s=F1x1glyRZFaeLuZ9jagCXu9QqBB8GUfEHpUHLSXfrJY&e=>
Virus-free.www.avg.com
<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=_1-rs70Ezxd5n-QRSTN5nB8DXCZZYTQHdfCPns8dtgjb0FGu-e7_61qDa4Gwecmw&s=F1x1glyRZFaeLuZ9jagCXu9QqBB8GUfEHpUHLSXfrJY&e=>
<#m_4427835302210338701_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
--
This email has been checked for viruses by AVG antivirus software.
www.avg.com
I have a much higher limit set in preferences, and your code works fine.
On 2026-01-21 08:23, nop head via Discuss wrote:
Just set a higher limit in preferences.
On Tue, 20 Jan 2026 at 21:15, Jon Bondy via Discuss discuss@lists.openscad.org wrote:
I realize that this code is long, but when I try to make it simpler, the bug fails to occur.
The bug is that if the for() at the end is [0:0], it works, but [0:1] blows up with the following (and OpenSCAD is dead and has to be restarted). Seems simple enough. Making one works, making two is fatal. I'm sure the problem is simple, but not to me, at the moment.
Thanks
Jon
Parsing design (AST generation)...
Used file cache size: 1 files
Compiling design (CSG Tree generation)...
ECHO: 23.25
Compiling design (CSG Products generation)...
Geometries in cache: 2
Geometry cache size in bytes: 26408
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
WARNING: Normalized tree is growing past 200000 elements. Aborting normalization.
Execution aborted
include <BOSL2/std.scad>
eps = 0.01;
$fa = 3;
$fs = 0.2;
inches = 25.4;
slop = 0.3; // printing slop
hth = 6.88; // thickness along curve horizontal thickness
vth = 4.83; // actual vertical thickness
ll = 21.25; // link length
// angles and diameters for rotation that creates the curved shape
id = 18.07;
od = id + hth;
ad = (id + od) / 2; // average diameter
an = round(asin(ll/ad))/2; // angle corresponding to "ll"
aSp = 12; // space between axels
xSp = ll + 2.0; // spacing of links
echo(xSp);
pd = 2.62 + slop; // pin diameter
// clearance around axle: I used 0.7, but metal printing needs 1.5
fmp = 0.0; // more clearance For Metal Printing (0.8)
clrc = 0.0; // clearance for clasp
clra = 0.0; // clearance for axles
module LinkShape()
// hull() rotated cylinders to make curved shape
for (a = [-an/2:1:an/2])
rotate([0, 0, a])
translate([ad, 0, 0])
cylinder(h = vth, d = hth);
*LinkShape();
module AxelHoles(sc) {
// "sc" allows cylinder diameter to be scaled for holes vs pins
aa = 0.40 * an; // axle hole angles
for (a = [-aa, aa])
rotate([0, 0, a])
translate([ad, 0, -eps])
cylinder(h = vth + 2*eps, d = pd*sc);
}
module Link(cutHoles)
rotate([0, -90, 90])
// Y
translate([-ad, 0, 0]) {
difference() {
LinkShape();
if (cutHoles)
AxelHoles(1);
}
}
*Link(true);
module PinAlignmentJig() {
difference() {
* translate([-12.5, -7.5, 0])
cube([25, 15, 2*vth+1]);
// link shape
translate([0, 0, 2*vth - eps])
scale([1.2, 1.4, 2.0])
rotate([90, 0, 0])
Link(false);
// the bottom link
translate([0, 0, vth - eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// the top link
translate([0, 0, 2*vth + 1 + eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// holes
translate([0, 21.51, -2])
rotate([0, 0, -90])
scale([1, 1, 9])
AxelHoles(1);
}
}
*PinAlignmentJig();
module PinAlignmentJigs() {
for (i = [0:1])
translate([0, i*20, 0])
PinAlignmentJig();
}
!PinAlignmentJigs();
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free.www.avg.com <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
<#m_4427835302210338701_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
Thanks.
I looked in Preferences for "normalized tree" and could not find anything.
What tab is this setting in, and what is it called, please?
Jon
On 1/20/2026 4:31 PM, Ken via Discuss wrote:
I have a much higher limit set in preferences, and your code works fine.
On 2026-01-21 08:23, nop head via Discuss wrote:
Just set a higher limit in preferences.
On Tue, 20 Jan 2026 at 21:15, Jon Bondy via Discuss
discuss@lists.openscad.org wrote:
I realize that this code is long, but when I try to make it
simpler, the bug fails to occur.
The bug is that if the for() at the end is [0:0], it works, but
[0:1] blows up with the following (and OpenSCAD is dead and has
to be restarted). Seems simple enough. Making one works, making
two is fatal. I'm sure the problem is simple, but not to me, at
the moment.
Thanks
Jon
Parsing design (AST generation)...
Used file cache size: 1 files
Compiling design (CSG Tree generation)...
ECHO: 23.25
Compiling design (CSG Products generation)...
Geometries in cache: 2
Geometry cache size in bytes: 26408
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
WARNING: Normalized tree is growing past 200000 elements.
Aborting normalization.
Execution aborted
include <BOSL2/std.scad>
eps = 0.01;
$fa = 3;
$fs = 0.2;
inches = 25.4;
slop = 0.3; // printing slop
hth = 6.88; // thickness along curve horizontal
thickness
vth = 4.83; // actual vertical thickness
ll = 21.25; // link length
// angles and diameters for rotation that creates the curved shape
id = 18.07;
od = id + hth;
ad = (id + od) / 2; // average diameter
an = round(asin(ll/ad))/2; // angle corresponding to "ll"
aSp = 12; // space between axels
xSp = ll + 2.0; // spacing of links
echo(xSp);
pd = 2.62 + slop; // pin diameter
// clearance around axle: I used 0.7, but metal printing needs 1.5
fmp = 0.0; // more clearance For Metal Printing (0.8)
clrc = 0.0; // clearance for clasp
clra = 0.0; // clearance for axles
module LinkShape()
// hull() rotated cylinders to make curved shape
for (a = [-an/2:1:an/2])
rotate([0, 0, a])
translate([ad, 0, 0])
cylinder(h = vth, d = hth);
*LinkShape();
module AxelHoles(sc) {
// "sc" allows cylinder diameter to be scaled for holes vs pins
aa = 0.40 * an; // axle hole angles
for (a = [-aa, aa])
rotate([0, 0, a])
translate([ad, 0, -eps])
cylinder(h = vth + 2*eps, d = pd*sc);
}
module Link(cutHoles)
rotate([0, -90, 90])
// Y
translate([-ad, 0, 0]) {
difference() {
LinkShape();
if (cutHoles)
AxelHoles(1);
}
}
*Link(true);
module PinAlignmentJig() {
difference() {
* translate([-12.5, -7.5, 0])
cube([25, 15, 2*vth+1]);
// link shape
translate([0, 0, 2*vth - eps])
scale([1.2, 1.4, 2.0])
rotate([90, 0, 0])
Link(false);
// the bottom link
translate([0, 0, vth - eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// the top link
translate([0, 0, 2*vth + 1 + eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// holes
translate([0, 21.51, -2])
rotate([0, 0, -90])
scale([1, 1, 9])
AxelHoles(1);
}
}
*PinAlignmentJig();
module PinAlignmentJigs() {
for (i = [0:1])
translate([0, i*20, 0])
PinAlignmentJig();
}
!PinAlignmentJigs();
<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=LwQfy2WcECey79_-nTEY2tcrp1ms20giK3igoGllV6y74lTTqIU0mW2WDI0xUumd&s=h_DosXQnxYNa2mfc3F183RfFXsir0Qfi_FZGiTpSAtE&e=>
Virus-free.www.avg.com
<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=LwQfy2WcECey79_-nTEY2tcrp1ms20giK3igoGllV6y74lTTqIU0mW2WDI0xUumd&s=h_DosXQnxYNa2mfc3F183RfFXsir0Qfi_FZGiTpSAtE&e=>
<#m_4427835302210338701_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
--
This email has been checked for viruses by AVG antivirus software.
www.avg.com
[image: image.png]
On Tue, 20 Jan 2026 at 21:53, Jon Bondy via Discuss <
discuss@lists.openscad.org> wrote:
Thanks.
I looked in Preferences for "normalized tree" and could not find anything.
What tab is this setting in, and what is it called, please?
Jon
On 1/20/2026 4:31 PM, Ken via Discuss wrote:
I have a much higher limit set in preferences, and your code works fine.
On 2026-01-21 08:23, nop head via Discuss wrote:
Just set a higher limit in preferences.
On Tue, 20 Jan 2026 at 21:15, Jon Bondy via Discuss <
discuss@lists.openscad.org> wrote:
I realize that this code is long, but when I try to make it simpler, the
bug fails to occur.
The bug is that if the for() at the end is [0:0], it works, but [0:1]
blows up with the following (and OpenSCAD is dead and has to be
restarted). Seems simple enough. Making one works, making two is fatal.
I'm sure the problem is simple, but not to me, at the moment.
Thanks
Jon
Parsing design (AST generation)...
Used file cache size: 1 files
Compiling design (CSG Tree generation)...
ECHO: 23.25
Compiling design (CSG Products generation)...
Geometries in cache: 2
Geometry cache size in bytes: 26408
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
WARNING: Normalized tree is growing past 200000 elements. Aborting
normalization.
Execution aborted
include <BOSL2/std.scad>
eps = 0.01;
$fa = 3;
$fs = 0.2;
inches = 25.4;
slop = 0.3; // printing slop
hth = 6.88; // thickness along curve horizontal thickness
vth = 4.83; // actual vertical thickness
ll = 21.25; // link length
// angles and diameters for rotation that creates the curved shape
id = 18.07;
od = id + hth;
ad = (id + od) / 2; // average diameter
an = round(asin(ll/ad))/2; // angle corresponding to "ll"
aSp = 12; // space between axels
xSp = ll + 2.0; // spacing of links
echo(xSp);
pd = 2.62 + slop; // pin diameter
// clearance around axle: I used 0.7, but metal printing needs 1.5
fmp = 0.0; // more clearance For Metal Printing (0.8)
clrc = 0.0; // clearance for clasp
clra = 0.0; // clearance for axles
module LinkShape()
// hull() rotated cylinders to make curved shape
for (a = [-an/2:1:an/2])
rotate([0, 0, a])
translate([ad, 0, 0])
cylinder(h = vth, d = hth);
*LinkShape();
module AxelHoles(sc) {
// "sc" allows cylinder diameter to be scaled for holes vs pins
aa = 0.40 * an; // axle hole angles
for (a = [-aa, aa])
rotate([0, 0, a])
translate([ad, 0, -eps])
cylinder(h = vth + 2eps, d = pdsc);
}
module Link(cutHoles)
rotate([0, -90, 90])
// Y
translate([-ad, 0, 0]) {
difference() {
LinkShape();
if (cutHoles)
AxelHoles(1);
}
}
*Link(true);
module PinAlignmentJig() {
difference() {
translate([-12.5, -7.5, 0])
cube([25, 15, 2*vth+1]);
// link shape
translate([0, 0, 2*vth - eps])
scale([1.2, 1.4, 2.0])
rotate([90, 0, 0])
Link(false);
// the bottom link
translate([0, 0, vth - eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// the top link
translate([0, 0, 2*vth + 1 + eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// holes
translate([0, 21.51, -2])
rotate([0, 0, -90])
scale([1, 1, 9])
AxelHoles(1);
}
}
module PinAlignmentJigs() {
for (i = [0:1])
translate([0, i*20, 0])
PinAlignmentJig();
}
!PinAlignmentJigs();
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=LwQfy2WcECey79_-nTEY2tcrp1ms20giK3igoGllV6y74lTTqIU0mW2WDI0xUumd&s=h_DosXQnxYNa2mfc3F183RfFXsir0Qfi_FZGiTpSAtE&e=
Virus-free.www.avg.com
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=LwQfy2WcECey79_-nTEY2tcrp1ms20giK3igoGllV6y74lTTqIU0mW2WDI0xUumd&s=h_DosXQnxYNa2mfc3F183RfFXsir0Qfi_FZGiTpSAtE&e=
<#m_-2402670767783250449_m_4427835302210338701_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Wow. Maybe the error message "normalized tree" could be changed, or the
entry in Preferences cold reference "normalized tree". There is no hint
that these two are associated. A newbie trap.
I thought this was an internal calculation issue, not a rendering issue.
Why would OpenSCAD roll over and die over a rendering issue?
I feel as if I've just started using OpenSCAD for the first time.
Thanks
On 1/20/2026 5:04 PM, nop head via Discuss wrote:
image.png
On Tue, 20 Jan 2026 at 21:53, Jon Bondy via Discuss
discuss@lists.openscad.org wrote:
Thanks.
I looked in Preferences for "normalized tree" and could not find
anything.
What tab is this setting in, and what is it called, please?
Jon
On 1/20/2026 4:31 PM, Ken via Discuss wrote:
I have a much higher limit set in preferences, and your code
works fine.
On 2026-01-21 08:23, nop head via Discuss wrote:
Just set a higher limit in preferences.
On Tue, 20 Jan 2026 at 21:15, Jon Bondy via Discuss
<discuss@lists.openscad.org> wrote:
I realize that this code is long, but when I try to make it
simpler, the bug fails to occur.
The bug is that if the for() at the end is [0:0], it works,
but [0:1] blows up with the following (and OpenSCAD is dead
and has to be restarted). Seems simple enough. Making one
works, making two is fatal. I'm sure the problem is simple,
but not to me, at the moment.
Thanks
Jon
Parsing design (AST generation)...
Used file cache size: 1 files
Compiling design (CSG Tree generation)...
ECHO: 23.25
Compiling design (CSG Products generation)...
Geometries in cache: 2
Geometry cache size in bytes: 26408
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
WARNING: Normalized tree is growing past 200000 elements.
Aborting normalization.
Execution aborted
include <BOSL2/std.scad>
eps = 0.01;
$fa = 3;
$fs = 0.2;
inches = 25.4;
slop = 0.3; // printing slop
hth = 6.88; // thickness along curve
horizontal thickness
vth = 4.83; // actual vertical thickness
ll = 21.25; // link length
// angles and diameters for rotation that creates the curved
shape
id = 18.07;
od = id + hth;
ad = (id + od) / 2; // average diameter
an = round(asin(ll/ad))/2; // angle corresponding to "ll"
aSp = 12; // space between axels
xSp = ll + 2.0; // spacing of links
echo(xSp);
pd = 2.62 + slop; // pin diameter
// clearance around axle: I used 0.7, but metal printing
needs 1.5
fmp = 0.0; // more clearance For Metal
Printing (0.8)
clrc = 0.0; // clearance for clasp
clra = 0.0; // clearance for axles
module LinkShape()
// hull() rotated cylinders to make curved shape
for (a = [-an/2:1:an/2])
rotate([0, 0, a])
translate([ad, 0, 0])
cylinder(h = vth, d = hth);
*LinkShape();
module AxelHoles(sc) {
// "sc" allows cylinder diameter to be scaled for holes
vs pins
aa = 0.40 * an; // axle hole angles
for (a = [-aa, aa])
rotate([0, 0, a])
translate([ad, 0, -eps])
cylinder(h = vth + 2*eps, d = pd*sc);
}
module Link(cutHoles)
rotate([0, -90, 90])
// Y
translate([-ad, 0, 0]) {
difference() {
LinkShape();
if (cutHoles)
AxelHoles(1);
}
}
*Link(true);
module PinAlignmentJig() {
difference() {
* translate([-12.5, -7.5, 0])
cube([25, 15, 2*vth+1]);
// link shape
translate([0, 0, 2*vth - eps])
scale([1.2, 1.4, 2.0])
rotate([90, 0, 0])
Link(false);
// the bottom link
translate([0, 0, vth - eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// the top link
translate([0, 0, 2*vth + 1 + eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// holes
translate([0, 21.51, -2])
rotate([0, 0, -90])
scale([1, 1, 9])
AxelHoles(1);
}
}
*PinAlignmentJig();
module PinAlignmentJigs() {
for (i = [0:1])
translate([0, i*20, 0])
PinAlignmentJig();
}
!PinAlignmentJigs();
<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=LwQfy2WcECey79_-nTEY2tcrp1ms20giK3igoGllV6y74lTTqIU0mW2WDI0xUumd&s=h_DosXQnxYNa2mfc3F183RfFXsir0Qfi_FZGiTpSAtE&e=>
Virus-free.www.avg.com
<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=LwQfy2WcECey79_-nTEY2tcrp1ms20giK3igoGllV6y74lTTqIU0mW2WDI0xUumd&s=h_DosXQnxYNa2mfc3F183RfFXsir0Qfi_FZGiTpSAtE&e=>
<#m_-2402670767783250449_m_4427835302210338701_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
--
Cheers, Ken
bats059@gmail.com
https://vk7krj.com <https://urldefense.proofpoint.com/v2/url?u=https-3A__vk7krj.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=LwQfy2WcECey79_-nTEY2tcrp1ms20giK3igoGllV6y74lTTqIU0mW2WDI0xUumd&s=mifxEm6ej2QUS3pb9wTEAJ8V0YN0bIleVL9MqQBWLYA&e=>
https://vk7krj.com/running.html <https://urldefense.proofpoint.com/v2/url?u=https-3A__vk7krj.com_running.html&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=LwQfy2WcECey79_-nTEY2tcrp1ms20giK3igoGllV6y74lTTqIU0mW2WDI0xUumd&s=G8vDxhcGbADfB1e8dcCUC0Qr5LqlxJYhmKBWhjoiqo8&e=>
----------------------------------------
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
--
This email has been checked for viruses by AVG antivirus software.
www.avg.com
Having changed rendering elements from 100,000 to 1,000,000, it now works.
And the normalized tree has ... 5,372 elements.
How does this compare to 100,000?
On 1/20/2026 5:04 PM, nop head via Discuss wrote:
image.png
On Tue, 20 Jan 2026 at 21:53, Jon Bondy via Discuss
discuss@lists.openscad.org wrote:
Thanks.
I looked in Preferences for "normalized tree" and could not find
anything.
What tab is this setting in, and what is it called, please?
Jon
On 1/20/2026 4:31 PM, Ken via Discuss wrote:
I have a much higher limit set in preferences, and your code
works fine.
On 2026-01-21 08:23, nop head via Discuss wrote:
Just set a higher limit in preferences.
On Tue, 20 Jan 2026 at 21:15, Jon Bondy via Discuss
<discuss@lists.openscad.org> wrote:
I realize that this code is long, but when I try to make it
simpler, the bug fails to occur.
The bug is that if the for() at the end is [0:0], it works,
but [0:1] blows up with the following (and OpenSCAD is dead
and has to be restarted). Seems simple enough. Making one
works, making two is fatal. I'm sure the problem is simple,
but not to me, at the moment.
Thanks
Jon
Parsing design (AST generation)...
Used file cache size: 1 files
Compiling design (CSG Tree generation)...
ECHO: 23.25
Compiling design (CSG Products generation)...
Geometries in cache: 2
Geometry cache size in bytes: 26408
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
WARNING: Normalized tree is growing past 200000 elements.
Aborting normalization.
Execution aborted
include <BOSL2/std.scad>
eps = 0.01;
$fa = 3;
$fs = 0.2;
inches = 25.4;
slop = 0.3; // printing slop
hth = 6.88; // thickness along curve
horizontal thickness
vth = 4.83; // actual vertical thickness
ll = 21.25; // link length
// angles and diameters for rotation that creates the curved
shape
id = 18.07;
od = id + hth;
ad = (id + od) / 2; // average diameter
an = round(asin(ll/ad))/2; // angle corresponding to "ll"
aSp = 12; // space between axels
xSp = ll + 2.0; // spacing of links
echo(xSp);
pd = 2.62 + slop; // pin diameter
// clearance around axle: I used 0.7, but metal printing
needs 1.5
fmp = 0.0; // more clearance For Metal
Printing (0.8)
clrc = 0.0; // clearance for clasp
clra = 0.0; // clearance for axles
module LinkShape()
// hull() rotated cylinders to make curved shape
for (a = [-an/2:1:an/2])
rotate([0, 0, a])
translate([ad, 0, 0])
cylinder(h = vth, d = hth);
*LinkShape();
module AxelHoles(sc) {
// "sc" allows cylinder diameter to be scaled for holes
vs pins
aa = 0.40 * an; // axle hole angles
for (a = [-aa, aa])
rotate([0, 0, a])
translate([ad, 0, -eps])
cylinder(h = vth + 2*eps, d = pd*sc);
}
module Link(cutHoles)
rotate([0, -90, 90])
// Y
translate([-ad, 0, 0]) {
difference() {
LinkShape();
if (cutHoles)
AxelHoles(1);
}
}
*Link(true);
module PinAlignmentJig() {
difference() {
* translate([-12.5, -7.5, 0])
cube([25, 15, 2*vth+1]);
// link shape
translate([0, 0, 2*vth - eps])
scale([1.2, 1.4, 2.0])
rotate([90, 0, 0])
Link(false);
// the bottom link
translate([0, 0, vth - eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// the top link
translate([0, 0, 2*vth + 1 + eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// holes
translate([0, 21.51, -2])
rotate([0, 0, -90])
scale([1, 1, 9])
AxelHoles(1);
}
}
*PinAlignmentJig();
module PinAlignmentJigs() {
for (i = [0:1])
translate([0, i*20, 0])
PinAlignmentJig();
}
!PinAlignmentJigs();
<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=LwQfy2WcECey79_-nTEY2tcrp1ms20giK3igoGllV6y74lTTqIU0mW2WDI0xUumd&s=h_DosXQnxYNa2mfc3F183RfFXsir0Qfi_FZGiTpSAtE&e=>
Virus-free.www.avg.com
<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=LwQfy2WcECey79_-nTEY2tcrp1ms20giK3igoGllV6y74lTTqIU0mW2WDI0xUumd&s=h_DosXQnxYNa2mfc3F183RfFXsir0Qfi_FZGiTpSAtE&e=>
<#m_-2402670767783250449_m_4427835302210338701_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
--
Cheers, Ken
bats059@gmail.com
https://vk7krj.com <https://urldefense.proofpoint.com/v2/url?u=https-3A__vk7krj.com&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=LwQfy2WcECey79_-nTEY2tcrp1ms20giK3igoGllV6y74lTTqIU0mW2WDI0xUumd&s=mifxEm6ej2QUS3pb9wTEAJ8V0YN0bIleVL9MqQBWLYA&e=>
https://vk7krj.com/running.html <https://urldefense.proofpoint.com/v2/url?u=https-3A__vk7krj.com_running.html&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=LwQfy2WcECey79_-nTEY2tcrp1ms20giK3igoGllV6y74lTTqIU0mW2WDI0xUumd&s=G8vDxhcGbADfB1e8dcCUC0Qr5LqlxJYhmKBWhjoiqo8&e=>
----------------------------------------
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
--
This email has been checked for viruses by AVG antivirus software.
www.avg.com
As nop head showed, in "Preferences- Advanced- Turn off rendering at", just set a very large number. I went for broke and put in 1000000000, it seems to work ok- or at least, I have had no more problems with that particular error since then🙂
On 2026-01-21 08:52, Jon Bondy wrote:
Thanks.
I looked in Preferences for "normalized tree" and could not find anything.
What tab is this setting in, and what is it called, please?
Jon
On 1/20/2026 4:31 PM, Ken via Discuss wrote:
I have a much higher limit set in preferences, and your code works fine.
On 2026-01-21 08:23, nop head via Discuss wrote:
Just set a higher limit in preferences.
On Tue, 20 Jan 2026 at 21:15, Jon Bondy via Discuss discuss@lists.openscad.org wrote:
I realize that this code is long, but when I try to make it simpler, the bug fails to occur.
The bug is that if the for() at the end is [0:0], it works, but [0:1] blows up with the following (and OpenSCAD is dead and has to be restarted). Seems simple enough. Making one works, making two is fatal. I'm sure the problem is simple, but not to me, at the moment.
Thanks
Jon
Parsing design (AST generation)...
Used file cache size: 1 files
Compiling design (CSG Tree generation)...
ECHO: 23.25
Compiling design (CSG Products generation)...
Geometries in cache: 2
Geometry cache size in bytes: 26408
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
WARNING: Normalized tree is growing past 200000 elements. Aborting normalization.
Execution aborted
include <BOSL2/std.scad>
eps = 0.01;
$fa = 3;
$fs = 0.2;
inches = 25.4;
slop = 0.3; // printing slop
hth = 6.88; // thickness along curve horizontal thickness
vth = 4.83; // actual vertical thickness
ll = 21.25; // link length
// angles and diameters for rotation that creates the curved shape
id = 18.07;
od = id + hth;
ad = (id + od) / 2; // average diameter
an = round(asin(ll/ad))/2; // angle corresponding to "ll"
aSp = 12; // space between axels
xSp = ll + 2.0; // spacing of links
echo(xSp);
pd = 2.62 + slop; // pin diameter
// clearance around axle: I used 0.7, but metal printing needs 1.5
fmp = 0.0; // more clearance For Metal Printing (0.8)
clrc = 0.0; // clearance for clasp
clra = 0.0; // clearance for axles
module LinkShape()
// hull() rotated cylinders to make curved shape
for (a = [-an/2:1:an/2])
rotate([0, 0, a])
translate([ad, 0, 0])
cylinder(h = vth, d = hth);
*LinkShape();
module AxelHoles(sc) {
// "sc" allows cylinder diameter to be scaled for holes vs pins
aa = 0.40 * an; // axle hole angles
for (a = [-aa, aa])
rotate([0, 0, a])
translate([ad, 0, -eps])
cylinder(h = vth + 2*eps, d = pd*sc);
}
module Link(cutHoles)
rotate([0, -90, 90])
// Y
translate([-ad, 0, 0]) {
difference() {
LinkShape();
if (cutHoles)
AxelHoles(1);
}
}
*Link(true);
module PinAlignmentJig() {
difference() {
* translate([-12.5, -7.5, 0])
cube([25, 15, 2*vth+1]);
// link shape
translate([0, 0, 2*vth - eps])
scale([1.2, 1.4, 2.0])
rotate([90, 0, 0])
Link(false);
// the bottom link
translate([0, 0, vth - eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// the top link
translate([0, 0, 2*vth + 1 + eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// holes
translate([0, 21.51, -2])
rotate([0, 0, -90])
scale([1, 1, 9])
AxelHoles(1);
}
}
*PinAlignmentJig();
module PinAlignmentJigs() {
for (i = [0:1])
translate([0, i*20, 0])
PinAlignmentJig();
}
!PinAlignmentJigs();
<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=LwQfy2WcECey79_-nTEY2tcrp1ms20giK3igoGllV6y74lTTqIU0mW2WDI0xUumd&s=h_DosXQnxYNa2mfc3F183RfFXsir0Qfi_FZGiTpSAtE&e=> Virus-free.www.avg.com <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com_email-2Dsignature-3Futm-5Fmedium-3Demail-26utm-5Fsource-3Dlink-26utm-5Fcampaign-3Dsig-2Demail-26utm-5Fcontent-3Demailclient&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=LwQfy2WcECey79_-nTEY2tcrp1ms20giK3igoGllV6y74lTTqIU0mW2WDI0xUumd&s=h_DosXQnxYNa2mfc3F183RfFXsir0Qfi_FZGiTpSAtE&e=>
<#m_4427835302210338701_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!
Jon,
Last year, AI kept writing C code when I asked it for OpenSCAD. But I'm
blown away how good it's gotten since then, and I've been using it all
the time for syntactically correct (and often semantically correct)
OpenSCAD programming.
It rewrote your module LinkShape() after ruminating on it for about 60
seconds. Visually the result seems to match well. With this, even /for
(i = [0 : 9])/ renders rapidly. See below.
Regards,
Curt
Gemini 3 Pro prompt:
This OpenSCAD program is very slow to execute and display. The
LinkShape() module creates tons of slightly overlapping cylinders,
creating large numbers of geometry elements. I think the performance
would be greatly improved if it could instead linear_extrude simpler 2D
shapes instead of doing the whole task starting from 3D objects.
/Upload .scad file/
Response:
Here is the optimized solution.
The slowness in your script comes from the |LinkShape()| module using a
|for| loop to generate geometry. This forces OpenSCAD to calculate the
union of hundreds of cylinders, which is an $O(N^2)$ or $O(N)$ operation
depending on the engine.
Replacing this with a 2D shape that is linear extruded changes the
complexity to $O(1)$ and renders nearly instantly.
Optimized Code
Replace your existing |LinkShape()| module with the version below.
|module LinkShape() { // Optimization: Create a 2D profile and extrude
it once // This replaces the loop of hundreds of cylinders
linear_extrude(height = vth) { union() { // 1. The curved body (Sector
of a ring) intersection() { difference() { circle(r = ad + hth/2); //
Outer radius circle(r = ad - hth/2); // Inner radius } // Mask to
strictly limit the arc to angles [-an/2 : an/2] // We use a polygon
wedge to slice the ring mask_r = ad + hth; // Radius large enough to
cover the shape polygon([ [0, 0], [mask_r * cos(-an/2), mask_r *
sin(-an/2)], [mask_r, 0], // Mid-point to ensure arc curvature is
covered [mask_r * cos(an/2), mask_r * sin(an/2)] ]); } // 2. The rounded
end-caps // These match the 'cylinder' diameters at the start/end of the
original loop rotate([0, 0, -an/2]) translate([ad, 0]) circle(d = hth);
rotate([0, 0, an/2]) translate([ad, 0]) circle(d = hth); } } } |
Why this works
*Geometric Equivalence:* The original code swept a cylinder of
diameter |hth| along an arc of radius |ad|. This creates a shape
with a constant thickness of |hth| and rounded ends. The new code
constructs this exact footprint in 2D using a ring sector
(|difference| of two circles) unioned with two circles at the ends
(|end-caps|).
*Performance:*
*
*Original:* ~40+ cylinder primitives per link $\times$ boolean
operations.
*
*New:* 1 extrusion object containing 4 simple 2D primitives.
Integration
You do not need to change |Link()| or |AxelHoles()|. This module acts as
a drop-in replacement that respects your global variables (|ad|, |an|,
|vth|, |hth|).
Would you like me to also optimize the |AxelHoles| module to ensure the
resolution (|$fn|) matches this new smooth curve perfectly?
/~~~ The End ~~~/
On 1/20/26 13:14, Jon Bondy via Discuss wrote:
I realize that this code is long, but when I try to make it simpler,
the bug fails to occur.
The bug is that if the for() at the end is [0:0], it works, but [0:1]
blows up with the following (and OpenSCAD is dead and has to be
restarted). Seems simple enough. Making one works, making two is
fatal. I'm sure the problem is simple, but not to me, at the moment.
Thanks
Jon
Parsing design (AST generation)...
Used file cache size: 1 files
Compiling design (CSG Tree generation)...
ECHO: 23.25
Compiling design (CSG Products generation)...
Geometries in cache: 2
Geometry cache size in bytes: 26408
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
WARNING: Normalized tree is growing past 200000 elements. Aborting
normalization.
Execution aborted
include <BOSL2/std.scad>
eps = 0.01;
$fa = 3;
$fs = 0.2;
inches = 25.4;
slop = 0.3; // printing slop
hth = 6.88; // thickness along curve horizontal thickness
vth = 4.83; // actual vertical thickness
ll = 21.25; // link length
// angles and diameters for rotation that creates the curved shape
id = 18.07;
od = id + hth;
ad = (id + od) / 2; // average diameter
an = round(asin(ll/ad))/2; // angle corresponding to "ll"
aSp = 12; // space between axels
xSp = ll + 2.0; // spacing of links
echo(xSp);
pd = 2.62 + slop; // pin diameter
// clearance around axle: I used 0.7, but metal printing needs 1.5
fmp = 0.0; // more clearance For Metal Printing (0.8)
clrc = 0.0; // clearance for clasp
clra = 0.0; // clearance for axles
module LinkShape()
// hull() rotated cylinders to make curved shape
for (a = [-an/2:1:an/2])
rotate([0, 0, a])
translate([ad, 0, 0])
cylinder(h = vth, d = hth);
*LinkShape();
module AxelHoles(sc) {
// "sc" allows cylinder diameter to be scaled for holes vs pins
aa = 0.40 * an; // axle hole angles
for (a = [-aa, aa])
rotate([0, 0, a])
translate([ad, 0, -eps])
cylinder(h = vth + 2eps, d = pdsc);
}
module Link(cutHoles)
rotate([0, -90, 90])
// Y
translate([-ad, 0, 0]) {
difference() {
LinkShape();
if (cutHoles)
AxelHoles(1);
}
}
*Link(true);
module PinAlignmentJig() {
difference() {
* translate([-12.5, -7.5, 0])
cube([25, 15, 2vth+1]);
// link shape
translate([0, 0, 2vth - eps])
scale([1.2, 1.4, 2.0])
rotate([90, 0, 0])
Link(false);
// the bottom link
translate([0, 0, vth - eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// the top link
translate([0, 0, 2*vth + 1 + eps])
rotate([90, 0, 0])
scale(1.04)
Link(false);
// holes
translate([0, 21.51, -2])
rotate([0, 0, -90])
scale([1, 1, 9])
AxelHoles(1);
}
}
*PinAlignmentJig();
module PinAlignmentJigs() {
for (i = [0:1])
translate([0, i*20, 0])
PinAlignmentJig();
}
!PinAlignmentJigs();
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient
Virus-free.www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org