Hello,
I'm trying to make a *.scad to build molds for "complex" parts that cannot
simply molded using Flat touching surfaces of the two parts mold.
The input of what I'm willing to mold is an extruded DXF, or a STL.
For example, let's say I want to mold a curve (let's say like this one :
http://www.ironcad.com/products/IronCADV7/Images/IsoCurve.gif of a thicnkess
of 2mm), I'll need the parts of my mold to "follow" the shape of my curve, I
really cannot simply make a difference().
Do you know a way to do that ? (remember that curve is just an example, but
I need to do it with différente shapes)
My idea is to make an approx using intersection() with very thin cubes, and
"ask" the software if intersection() { my_shape cube} does not intersect,
move the cube slightly (with a for() ) and try again until intersection() {
my_shape cube} actually doex something and keep a difference(){ cube
my_shape} to be a part of my mold.
If I do this on every single place of my shape (with another for() ), I'll
have a extrusion of my_shape top part, which will be the first part of my
mold. Doing the same at the bottom will produce a 2 parts mold of my_shape.
How can I do that ?
I'd like something like
for (i = [0 : 100])
{
translate([0,0,-i])
cube([0.1,0.1,100]);
if intersection(){my_shape cube} = false,
then start the for again (and iterate i )
}
else difference(){
translate([0,0,-i])
cube([0.1,0.1,100]);
my_shape
}
My problem is in the fact that I cannot find a way to know if intersection()
does something or not. I can only see it when it actually does nothing, the
debugger says "no top level object found"
Thank you for you help
--
View this message in context: http://forum.openscad.org/If-intersection-tp13488.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
You could try projection and cut=true as you translate object through Z.
But question remains - How to tell if you have any geometry as a result.
Unless you use an external program to examine the resulting shapes....
--
View this message in context: http://forum.openscad.org/If-intersection-tp13488p13489.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
I think you can manage this with a simple difference()-minkowski() operation:
debug=true;
difference() {
minkowski() {
sphere(r=2.0);
yourObject();
}
yourObject();
if(debug) {
cube([100,100,100],center=false);
}
}
That will get you a “shell” 2.0 units thick around the ‘yourObject(); empty volume.
Caveat: If ‘yourObject();’ has hollow volumes, those will be positive-space volumes suspended in the resulting shape.
Otherwise, if you do really want a “geometric selection” operator you’ll have to do something like this:
https://github.com/clothbot/ClothBotCreations/blob/master/examples/quantize.scad https://github.com/clothbot/ClothBotCreations/blob/master/examples/quantize.scad
It’s non-trivial and rather computationally intensive to say the least, but it works… after a fashion. :-)
Andrew.
On Aug 9, 2015, at 10:58 AM, FrenchKey_fr alexandre@ouverturefine.com wrote:
Hello,
I'm trying to make a *.scad to build molds for "complex" parts that cannot
simply molded using Flat touching surfaces of the two parts mold.
The input of what I'm willing to mold is an extruded DXF, or a STL.
For example, let's say I want to mold a curve (let's say like this one :
http://www.ironcad.com/products/IronCADV7/Images/IsoCurve.gif of a thicnkess
of 2mm), I'll need the parts of my mold to "follow" the shape of my curve, I
really cannot simply make a difference().
Do you know a way to do that ? (remember that curve is just an example, but
I need to do it with différente shapes)
My idea is to make an approx using intersection() with very thin cubes, and
"ask" the software if intersection() { my_shape cube} does not intersect,
move the cube slightly (with a for() ) and try again until intersection() {
my_shape cube} actually doex something and keep a difference(){ cube
my_shape} to be a part of my mold.
If I do this on every single place of my shape (with another for() ), I'll
have a extrusion of my_shape top part, which will be the first part of my
mold. Doing the same at the bottom will produce a 2 parts mold of my_shape.
How can I do that ?
I'd like something like
for (i = [0 : 100])
{
translate([0,0,-i])
cube([0.1,0.1,100]);
if intersection(){my_shape cube} = false,
then start the for again (and iterate i )
}
else difference(){
translate([0,0,-i])
cube([0.1,0.1,100]);
my_shape
}
My problem is in the fact that I cannot find a way to know if intersection()
does something or not. I can only see it when it actually does nothing, the
debugger says "no top level object found"
Thank you for you help
--
View this message in context: http://forum.openscad.org/If-intersection-tp13488.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Have a look at the command surface().
Here are some links interesting links if you can convert your surface to a
grey scale image.
There are some different ways to import them into OpenSCAD:
http://aggregate.org/MAKE/TRACE2SCAD/
http://blog.cubehero.com/2013/11/11/how-to-generate-extruded-3d-model-from-images-in-openscad/
On second-reading, I’ve been playing with some “directed minkowski” module code that may be of use:
https://github.com/clothbot/ClothBotCreations/blob/master/utilities/directed_minkowski.scad https://github.com/clothbot/ClothBotCreations/blob/master/utilities/directed_minkowski.scad
You could try using it to create a “directed up” half and a “directed down” half.
Andrew.
On Aug 9, 2015, at 10:58 AM, FrenchKey_fr alexandre@ouverturefine.com wrote:
Hello,
I'm trying to make a *.scad to build molds for "complex" parts that cannot
simply molded using Flat touching surfaces of the two parts mold.
The input of what I'm willing to mold is an extruded DXF, or a STL.
For example, let's say I want to mold a curve (let's say like this one :
http://www.ironcad.com/products/IronCADV7/Images/IsoCurve.gif of a thicnkess
of 2mm), I'll need the parts of my mold to "follow" the shape of my curve, I
really cannot simply make a difference().
Do you know a way to do that ? (remember that curve is just an example, but
I need to do it with différente shapes)
My idea is to make an approx using intersection() with very thin cubes, and
"ask" the software if intersection() { my_shape cube} does not intersect,
move the cube slightly (with a for() ) and try again until intersection() {
my_shape cube} actually doex something and keep a difference(){ cube
my_shape} to be a part of my mold.
If I do this on every single place of my shape (with another for() ), I'll
have a extrusion of my_shape top part, which will be the first part of my
mold. Doing the same at the bottom will produce a 2 parts mold of my_shape.
How can I do that ?
I'd like something like
for (i = [0 : 100])
{
translate([0,0,-i])
cube([0.1,0.1,100]);
if intersection(){my_shape cube} = false,
then start the for again (and iterate i )
}
else difference(){
translate([0,0,-i])
cube([0.1,0.1,100]);
my_shape
}
My problem is in the fact that I cannot find a way to know if intersection()
does something or not. I can only see it when it actually does nothing, the
debugger says "no top level object found"
Thank you for you help
--
View this message in context: http://forum.openscad.org/If-intersection-tp13488.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
The loop
for (i = [0 : Step:100])
{ function z { ... }
function z-height { ... }
translate([x,y,z])
cube([0.1,0.1,z-height]);
}
is enough to do it. All it takes is to obtain a mathematical expression for
the coordinates x,y,z and the amplitude z-height of your thing-to-be-made.
One way of doing that is by using Bezier functionality. See e.g.
http://www.thingiverse.com/thing:8786/#files
Another is to enter the coordinates as lists and write an extraction
routine. This is how http://www.thingiverse.com/thing:59817/#files creates
letters from cubes.
Enjoy!
--
View this message in context: http://forum.openscad.org/If-intersection-tp13488p13493.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Sorry, there is a mistake in the code fragment I sent
You don't need 4 dimensions to describe a 3-D object
This will do
for (i = [0 : Step:100])
{ function z { ... } // here you enter z=f(x,y) the coordinates of
your surface and get the height as response
translate([x,y,0])
cube([Step,Step,z]); //as union() is implied by a for loop, no need to
call it
}
For more details, look up in http://www.thingiverse.com for either "openscad
height maps" or" bezier" to find more
--
View this message in context: http://forum.openscad.org/If-intersection-tp13488p13494.html
Sent from the OpenSCAD mailing list archive at Nabble.com.