I use OpenSCAD for 3D as well as 2D designs. I am making a pattern for
drilling holes in wood, once my design is done I think use the projection
function so I can print the drill pattern.
How would I go about putting cross hairs in the center of the cylinder so
that I make sure I am drilling directly in the center of the cylinder? This
particular design do not have to be super accurate but very close would be
nice. It is for a piece of plywood 12" x 13.5" with a bunch 1.5" holes
drilled.
Would I have to make 2 very thin cubes in the center of the cylinder or is
there a better way to do this?
--
Sent from: http://forum.openscad.org/
I make drill templates by post processing DXF files exported from OpenSCAD
with Python scripts that make PDF files with cross hairs on the circles and
show the diameter numerically. The scripts are on github:
https://github.com/nophead/Mendel90/blob/master/sheets.py and an example
drill template here:
https://github.com/nophead/Mendel90/blob/master/sturdy/sheets/frame_gantry.pdf
On 15 August 2018 at 16:49, fractorr fractorr@gmail.com wrote:
I use OpenSCAD for 3D as well as 2D designs. I am making a pattern for
drilling holes in wood, once my design is done I think use the projection
function so I can print the drill pattern.
How would I go about putting cross hairs in the center of the cylinder so
that I make sure I am drilling directly in the center of the cylinder?
This
particular design do not have to be super accurate but very close would be
nice. It is for a piece of plywood 12" x 13.5" with a bunch 1.5" holes
drilled.
Would I have to make 2 very thin cubes in the center of the cylinder or is
there a better way to do this?
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
One of hundred ways is to draw everything with 2D primitives using 2 or
better 4 rects as crosshairs and differences of circles as circle lines.
Then switch to top view (Ctrl+4) and save with file/export/image. After that
print the image in the desired size. You also can show the axes as cross
hairs (Ctrl+2).
e.g.
$fn=60;
for (r = [10:14])
difference()
{
circle(r);
circle((r-.04 ));
}
for(i = [0:90:360])
rotate([0,0,i]) translate([2.8,0,0]) square([5,.1], center = true);
--
Sent from: http://forum.openscad.org/
Thanks, that looks like that should work. I will give that a try.
On Wed, Aug 15, 2018 at 9:09 AM nop head nop.head@gmail.com wrote:
I make drill templates by post processing DXF files exported from OpenSCAD
with Python scripts that make PDF files with cross hairs on the circles and
show the diameter numerically. The scripts are on github:
https://github.com/nophead/Mendel90/blob/master/sheets.py and an example
drill template here:
https://github.com/nophead/Mendel90/blob/master/sturdy/sheets/frame_gantry.pdf
On 15 August 2018 at 16:49, fractorr fractorr@gmail.com wrote:
I use OpenSCAD for 3D as well as 2D designs. I am making a pattern for
drilling holes in wood, once my design is done I think use the projection
function so I can print the drill pattern.
How would I go about putting cross hairs in the center of the cylinder so
that I make sure I am drilling directly in the center of the cylinder?
This
particular design do not have to be super accurate but very close would be
nice. It is for a piece of plywood 12" x 13.5" with a bunch 1.5" holes
drilled.
Would I have to make 2 very thin cubes in the center of the cylinder or is
there a better way to do this?
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I's make my own cylinder module. I'd probably call it hole, just for code
clarity. Then, I'd add a parameter crosshairs, and if false, it just does
the cylinder as normal, if true, it instead does the crosshairs (and
anything else I might want, such as printed dimensions).
Then, first call it in the difference() to make the hole, then call it again
outside with the same parameters, but with crosshairs=true to draw the
crosshair.
This kind of stuff is pretty common, and it would be much easier if OpenSCAD
handled "negative objects", because then, the hole could be negative and the
crosshair positive, so you could add them in one operation. But, it doesn't,
so we need a workaround.
--
Sent from: http://forum.openscad.org/
Then, first call it in the difference() to make the hole, then call it
again
outside with the same parameters, but with crosshairs=true to draw the
crosshair.
When crosshairs is true you could make hole draw the difference between a
cylinder and a cross. That way you don't need to call it twice.
On 16 August 2018 at 06:10, Troberg troberg.anders@gmail.com wrote:
I's make my own cylinder module. I'd probably call it hole, just for code
clarity. Then, I'd add a parameter crosshairs, and if false, it just does
the cylinder as normal, if true, it instead does the crosshairs (and
anything else I might want, such as printed dimensions).
Then, first call it in the difference() to make the hole, then call it
again
outside with the same parameters, but with crosshairs=true to draw the
crosshair.
This kind of stuff is pretty common, and it would be much easier if
OpenSCAD
handled "negative objects", because then, the hole could be negative and
the
crosshair positive, so you could add them in one operation. But, it
doesn't,
so we need a workaround.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
On 8/15/2018 10:10 PM, Troberg wrote:
This kind of stuff is pretty common, and it would be much easier if OpenSCAD
handled "negative objects", because then, the hole could be negative and the
crosshair positive, so you could add them in one operation. But, it doesn't,
so we need a workaround.
I think about negative objects occasionally, and when I start to think
about them too deeply I realize that I don't know what they would really
mean.
It seems "obvious" that a 3" sphere unioned with a negative 2" sphere is
a hollow sphere. But then what do you get if you union in a 1" sphere?
Do you get a sphere floating inside a sphere, or does the negativeness
of the 2" sphere win and destroy the 1" sphere? You might think that
you could do addition and subtraction, so that a positive object plus a
negative object plus a positive object yields a positive object, but
that wouldn't be right either - often you'd want to drill a hole through
something that is itself a union of several things.
Does anybody have a full model for how negative objects would behave?
On 16. aug. 2018 18:14, Jordan Brown wrote:
It seems "obvious" that a 3" sphere unioned with a negative 2"
sphere is a hollow sphere.
Result = S3 + -S2 = S3 - S2
I.e. a "union with a negative" is the same as difference. Negative
objects are not required.
But then what do you get if you union in a 1" sphere?
Do you get a sphere floating inside a sphere,
Sure, just try it:
union()
{
difference()
{
sphere(30);
sphere(20);
}
sphere(10);
}
To see the inside of it, cut away an octant
difference()
{
union()
{
difference()
{
sphere(30);
sphere(20);
}
sphere(10);
}
cube(50);
}
Standard stuff.
Carsten Arnholm
This is what I came up with. This is just test code to see if it was what
I want and it is, I just need to figure out how to incorporate this into my
project code.
$fn=60;
module hole()
{
cylinder(100, d=50);
}
module crosshairs()
{
for(i = [0:90:360])
rotate([0, 0, i])
translate([0, 0, 75])
cube([20, 1, 50], center = true);
}
projection()
{
union()
{
difference()
{
cube([1000, 1000, 50]);
for (h = [1:5])
translate([100*h, 100, -50])
hole();
}
for (h = [1:5])
translate([100*h, 100, -50])
crosshairs();
}
}
On Thu, Aug 16, 2018 at 2:31 AM nop head nop.head@gmail.com wrote:
Then, first call it in the difference() to make the hole, then call it
again
outside with the same parameters, but with crosshairs=true to draw the
crosshair.
When crosshairs is true you could make hole draw the difference between a
cylinder and a cross. That way you don't need to call it twice.
On 16 August 2018 at 06:10, Troberg troberg.anders@gmail.com wrote:
I's make my own cylinder module. I'd probably call it hole, just for code
clarity. Then, I'd add a parameter crosshairs, and if false, it just does
the cylinder as normal, if true, it instead does the crosshairs (and
anything else I might want, such as printed dimensions).
Then, first call it in the difference() to make the hole, then call it
again
outside with the same parameters, but with crosshairs=true to draw the
crosshair.
This kind of stuff is pretty common, and it would be much easier if
OpenSCAD
handled "negative objects", because then, the hole could be negative and
the
crosshair positive, so you could add them in one operation. But, it
doesn't,
so we need a workaround.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
factorr, I'm not particularly qualified to address the overall code, but
wanted to point out something that may bite you in the future.
module crosshairs()
{
for(i = [0:90:360])
rotate([0, 0, i])
translate([0, 0, 75])
cube([20, 1, 50], center = true);
The for loop will generate five features. Starting point of zero is one and
the 90° increment to the ending point of 360 is number five. I believe in
your specific instance it won't matter, but watch out for zero starting
points and desired ending points for these types of loops. You can see that
changing the end loop figure to 270 gives the same visual results without
the "overlap" of the feature being created.
--
Sent from: http://forum.openscad.org/