discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: Merging sub-assemblies?

JB
Jordan Brown
Tue, May 11, 2021 10:04 PM

On 5/11/2021 2:54 PM, Terrypin via Discuss wrote:

Spent an hour or two working on ways to manipulate the displayed
results so that I could measure the dimensions of my various attempts
precisely. Any consensus on best method please? I zoomed in greatly
and rotated so that axis markings visible (with transparency if
necessary).  One odd thing: the numbering seems to stop at some point
around 90 when zoomed near max. So, for example, I could accurately
determine the wall thickness near (0,0,0), but ensuring the box was
143 long was trickier.

Mostly you don't want to be measuring - you want to be specifying.  If
you want a box to be 143 units long then that's how big you construct
it.  With cylinder-plus-hull construction, your overall dimensions are
the distances between the centerpoints of the cylinders, plus twice the
radius of the cylinders.

Hint, BTW:  if you want different radii on two sides of a box, you need
a torus at the corner.

For those rare times when I want to measure, here's the measuring stick
that I use.  It's used like a real-life measuring stick, positioned in
the model against the points to be measured.

module measuringstick(len, interval=pow(10,floor(log($vpd)-1)), center=false) {
if (!is_undef($measure) && $measure) {
r = 0.5;
mark = interval * 0.01;
%translate([0, 0, center ? -len/2 : 0]) {
for (z=[0:interval:len]) {
mark1 = min(len-z, mark/2);
if (mark1 > 0) {
translate([0,0,z]) color("black") cylinder(r=r, h=mark/2);
}
z2 = z + mark1;
block = min(len-z2, interval-mark);
if (block > 0) {
translate([0,0,z2]) cylinder(r=r, h=block);
}
z3 = z2 + block;
mark2 = min(len-z3, mark/2);
if (mark2 > 0) {
translate([0,0,z3]) color("black") cylinder(r=r, h=mark/2);
}
}
}
}
}

On 5/11/2021 2:54 PM, Terrypin via Discuss wrote: > Spent an hour or two working on ways to manipulate the displayed > results so that I could measure the dimensions of my various attempts > precisely. Any consensus on best method please? I zoomed in greatly > and rotated so that axis markings visible (with transparency if > necessary).  One odd thing: the numbering seems to stop at some point > around 90 when zoomed near max. So, for example, I could accurately > determine the wall thickness near (0,0,0), but ensuring the box was > 143 long was trickier. Mostly you don't want to be measuring - you want to be *specifying*.  If you want a box to be 143 units long then that's how big you construct it.  With cylinder-plus-hull construction, your overall dimensions are the distances between the centerpoints of the cylinders, plus twice the radius of the cylinders. Hint, BTW:  if you want different radii on two sides of a box, you need a torus at the corner. For those rare times when I want to measure, here's the measuring stick that I use.  It's used like a real-life measuring stick, positioned in the model against the points to be measured. module measuringstick(len, interval=pow(10,floor(log($vpd)-1)), center=false) { if (!is_undef($measure) && $measure) { r = 0.5; mark = interval * 0.01; %translate([0, 0, center ? -len/2 : 0]) { for (z=[0:interval:len]) { mark1 = min(len-z, mark/2); if (mark1 > 0) { translate([0,0,z]) color("black") cylinder(r=r, h=mark/2); } z2 = z + mark1; block = min(len-z2, interval-mark); if (block > 0) { translate([0,0,z2]) cylinder(r=r, h=block); } z3 = z2 + block; mark2 = min(len-z3, mark/2); if (mark2 > 0) { translate([0,0,z3]) color("black") cylinder(r=r, h=mark/2); } } } } }
T
Terrypin
Wed, May 12, 2021 7:32 AM

Thanks, that tool looks fascinating. I’ll try it next time I need to reassure
myself about dimension accuracy.

The situation in the case I described was because in exasperation I was
resorting to trial and error after losing control of my intended geometry! I
made a better job of it on my subsequent more methodical attempt.

--
Sent from: http://forum.openscad.org/

Thanks, that tool looks fascinating. I’ll try it next time I need to reassure myself about dimension accuracy. The situation in the case I described was because in exasperation I was resorting to trial and error after losing control of my intended geometry! I made a better job of it on my subsequent more methodical attempt. -- Sent from: http://forum.openscad.org/
T
Terrypin
Wed, May 12, 2021 12:57 PM

Here's my version based on hull with cylinders. I also used the exercise to
learn how to work with modules, so that I can make more of these in future.

http://forum.openscad.org/file/t3184/DryBox-Hull-Cyl-3-SCAD.jpg

The top for the box is shown here:
https://www.dropbox.com/s/m90ckyv7u5phnwa/DualMainsSockets-1.jpg?raw=1
https://www.dropbox.com/s/m90ckyv7u5phnwa/DualMainsSockets-1.jpg?raw=1

I estimated the roundness, r, by finding an object that fitted a corner
neatly; this pad had a radius of about 3mm:

https://www.dropbox.com/s/n6zjhnv8d8r0019/RoundnessEstimate.jpg?dl=0httraw=1
https://www.dropbox.com/s/n6zjhnv8d8r0019/RoundnessEstimate.jpg?dl=0httraw=1

P.S. I originally used 'Insert Image' for the two photos but preview showed
them at full size. Hence my reverting to links. How /should /images be
displayed in familiar thumbnail form, or limited to screen size for
reasonable viewing please?

--
Sent from: http://forum.openscad.org/

Here's my version based on hull with cylinders. I also used the exercise to learn how to work with modules, so that I can make more of these in future. <http://forum.openscad.org/file/t3184/DryBox-Hull-Cyl-3-SCAD.jpg> The top for the box is shown here: https://www.dropbox.com/s/m90ckyv7u5phnwa/DualMainsSockets-1.jpg?raw=1 <https://www.dropbox.com/s/m90ckyv7u5phnwa/DualMainsSockets-1.jpg?raw=1> I estimated the roundness, r, by finding an object that fitted a corner neatly; this pad had a radius of about 3mm: https://www.dropbox.com/s/n6zjhnv8d8r0019/RoundnessEstimate.jpg?dl=0httraw=1 <https://www.dropbox.com/s/n6zjhnv8d8r0019/RoundnessEstimate.jpg?dl=0httraw=1> P.S. I originally used 'Insert Image' for the two photos but preview showed them at full size. Hence my reverting to links. How /should /images be displayed in familiar thumbnail form, or limited to screen size for reasonable viewing please? -- Sent from: http://forum.openscad.org/
T
Terrypin
Wed, May 12, 2021 1:03 PM

Here's my version based on hull with cylinders. I also used the exercise to
learn how to work with modules, so that I can make more of these in future.

http://forum.openscad.org/file/t3184/DryBox-Hull-Cyl-3-SCAD.jpg

The top for the box is shown here:
https://www.dropbox.com/s/m90ckyv7u5phnwa/DualMainsSockets-1.jpg?raw=1
https://www.dropbox.com/s/m90ckyv7u5phnwa/DualMainsSockets-1.jpg?raw=1

I estimated the roundness, r, by finding an object that fitted a corner
neatly; this pad had a radius of about 3mm:

https://www.dropbox.com/s/n6zjhnv8d8r0019/RoundnessEstimate.jpg?dl=0httraw=1
https://www.dropbox.com/s/n6zjhnv8d8r0019/RoundnessEstimate.jpg?dl=0httraw=1

P.S. I originally used 'Insert Image' for the two photos but preview showed
them at full size. Hence my reverting to links. How /should /images be
displayed in familiar thumbnail form, or limited to screen size for
reasonable viewing please?

--
Sent from: http://forum.openscad.org/

Here's my version based on hull with cylinders. I also used the exercise to learn how to work with modules, so that I can make more of these in future. <http://forum.openscad.org/file/t3184/DryBox-Hull-Cyl-3-SCAD.jpg> The top for the box is shown here: https://www.dropbox.com/s/m90ckyv7u5phnwa/DualMainsSockets-1.jpg?raw=1 <https://www.dropbox.com/s/m90ckyv7u5phnwa/DualMainsSockets-1.jpg?raw=1> I estimated the roundness, r, by finding an object that fitted a corner neatly; this pad had a radius of about 3mm: https://www.dropbox.com/s/n6zjhnv8d8r0019/RoundnessEstimate.jpg?dl=0httraw=1 <https://www.dropbox.com/s/n6zjhnv8d8r0019/RoundnessEstimate.jpg?dl=0httraw=1> P.S. I originally used 'Insert Image' for the two photos but preview showed them at full size. Hence my reverting to links. How /should /images be displayed in familiar thumbnail form, or limited to screen size for reasonable viewing please? -- Sent from: http://forum.openscad.org/