Bonjour !
Fileting 3D parts is still a an enigma for me.
I'd like to obtain this (using minkowsky)
http://forum.openscad.org/file/n20610/guitar_rest_fillet.jpg
The minkowsky transformation takes ages to render and screws up dimensions.
How can I obtain the fileted part seen in top pic. without using minkowsky ?
Here is the code :
//offset_3d() {
difference() {
cube([50, 50, 35], center = true);
union() {
translate([31,0,0])
cube([75, 65, 29.8], center = true);
translate([-35, 0, 0])
cylinder(h= 60, r1= 25, r2=25, center = true, $fn=20);
translate([-14,-26,0])
cylinder (h=30, d=12, center= true, $fn=100);
translate([-14,26,0])
cylinder (h=30, d=12, center= true, $fn=50);
}
}
//}
module offset_3d(r=1.5) {
for(k=[0:$children-1]) minkowski() {
children(k);
sphere(r=r,$fn=8);
}
}
//* * * * * * * * * * * * * *
Thanks in advance for any input.
Dan
--
View this message in context: http://forum.openscad.org/Fileting-again-tp20610.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
My computer has rendered your model in 103 sec. It is a reasonable time.
Yes, minkowski() changes the model dimensions adding the dimensions of the
two (or more) models it operates on. To solve this, subtract the sphere
diameter from each positive cube and add it to each negative primitive
dimensions composing your model before applying minkowski. That is, apply
minkowski to a negative offset of your model. This process has some
constraints.
module filleted_model(rad=1.2) {
// for rad>1.2, some parts of the model would vanish in the negative
offset
if(rad>1.2) model(); // your original model, without filleting
else
offset_3d(rad)
difference() {
cube([50-2rad, 50-2rad, 35-2rad], center = true); // positive
union() { // negative
translate([31,0,0])
cube([75+2rad, 65+2rad, 29.8+2rad], center = true);
translate([-35, 0, 0])
cylinder(h= 60+2rad, r1= 25+rad, r2=25+rad, center =
true, $fn=20);
translate([-14,-26,0])
cylinder (h=30+2rad, d=12+2rad, center= true,
$fn=100);
translate([-14,26,0])
cylinder (h=30+2rad, d=12+2*rad, center= true, $fn=50);
}
}
}
I don't know any other way to do it.
2017-02-27 7:18 GMT-03:00 stressless wintoweb@gmail.com:
The minkowsky transformation takes ages to render and screws up dimensions.
How can I obtain the fileted part seen in top pic. without using minkowsky
?
If I understood correctly, what it is, you want this should do the trick:
module offset_3d(r=1.5, size=60)
{
difference()
{
children();
difference()
{
children();
minkowski()
{
difference()
{
cube(size,center=true);
children();
}
sphere(r,$fn=8);
}
}
}
}
--
View this message in context: http://forum.openscad.org/Filleting-again-tp20610p20638.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
It works but the following is simpler and faster:
module negative_offset_3d(r=1, size=1000){
difference()
{
cube(size-1,center=true);
minkowski()
{
difference()
{
cube(size,center=true);
children();
}
sphere(r,$fn=8);
}
}
}
If you don't know the diameter of the model (size), you will need a second
minkowski, though.
--
View this message in context: http://forum.openscad.org/Filleting-again-tp20610p20650.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Ronaldo and Noil,
Thanks for your input but I cannot make it work. I get no filleting on my
part at all using your solutions.
As an example, could you please integrate these modules into my original
code so that I can understand ? (blushing Newbie)
Here it is again :
$fn=20;
offset_3d() {
difference() {
cube([50, 50, 35], center = true);
union() {
translate([31,0,0])
cube([75, 65, 31.8], center = true);
translate([-35, 0, 0])
cylinder(h= 60, r1= 25, r2=25, center = true);
translate([-14,-26,0])
cylinder (h=30, d=12, center= true, $fn=20);
translate([-14,26,0])
cylinder (h=30, d=12, center= true, $fn=20);
}
}
}
module offset_3d(r=1.0) {
for(k=[0:$children-1]) minkowski() {
children(k);
sphere(r=r,$fn=8);
}
}
Thanks a bunch.
Dan
On Tue, Feb 28, 2017 at 4:20 PM, Ronaldo [via OpenSCAD] <
ml-node+s1091067n20650h73@n5.nabble.com> wrote:
It works but the following is simpler and faster:
module negative_offset_3d(r=1, size=1000){
difference()
{
cube(size-1,center=true);
minkowski()
{
difference()
{
cube(size,center=true);
children();
}
sphere(r,$fn=8);
}
}
}
If you don't know the diameter of the model (size), you will need a second
minkowski, though.
If you reply to this email, your message will be added to the discussion
below:
http://forum.openscad.org/Filleting-again-tp20610p20650.html
To unsubscribe from Filleting again..., click here
http://forum.openscad.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=20610&code=d2ludG93ZWJAZ21haWwuY29tfDIwNjEwfDg2NDUxNDIyMg==
.
NAML
http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
--
- Composants électroniques pour votre Hobby => www.pepTronic.ch
http://www.pepTronic.ch
--
View this message in context: http://forum.openscad.org/Filleting-again-tp20610p20683.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
In the following code, it is used a general offset_3d module that accepts
both positive and negative offsets.
To apply the filleting we proceed like in the 2D case: first offset the
model by -r then offset it by r so that the object general dimensions are
preserved. Note that I have chosen r=0.7 instead of r=1 in your example;
the thickness of the two horizontal flaps is (35-31.8)/2 = 1.6 so the
maximum offset radius should be 0.8 otherwise some parts of your object
will vanish with the negative offset. Try it to see.
render()
//offset_3d(-0.7)
//offset_3d(0.7)
offset_3d(0.7)
offset_3d(-0.7) stressless_model()
module stressless_model()
difference() {
cube([50, 50, 35], center = true);
union() {
translate([31,0,0])
cube([75, 65, 31.8], center = true);
translate([-35, 0, 0])
cylinder(h= 60, r1= 25, r2=25, center = true);
translate([-14,-26,0])
cylinder (h=30, d=12, center= true, $fn=20);
translate([-14,26,0])
cylinder (h=30, d=12, center= true, $fn=20);
}
}
module offset_3d(r=1, size=1e12) {
n = $fn==undef ? 12: $fn;
if(r==0) children();
else
if( r>0 )
minkowski(){
children();
sphere(r, $fn=n);
}
else {
size2 = size*[1,1,1];
size1 = size2*0.99;
difference(){
cube(size2, center=true);
minkowski(){
difference(){
cube(size1, center=true);
children();
}
sphere(-r, $fn=n);;
}
}
}
}
This filleting is applied only on "convex edges" (the edges whose outer
dihedral angle https://en.wikipedia.org/wiki/Dihedral_angle is greater
than 180 degrees). To fillet the other edges the offset operation order
should be inverted. To fillet all edges 4 offset_3d() operations should be
applied in sequence (uncomment the two commented lines to see it - be very
patient).
Each offset_3d() operation involves a minkowski and increases the number of
vertices of the model. So, the next offset_3d() will take even longer time.
My rather old notebook spent more than 7 min to render the code above.
Ronaldo wrote
In the following code, it is used a general offset_3d module that accepts
both positive and negative offsets. To apply the filleting we proceed like
in the 2D case: first offset the model by -r then offset it by r so that
the object general dimensions are preserved. Note that I have chosen r=0.7
instead of r=1 in your example; the thickness of the two horizontal flaps
is (35-31.8)/2 = 1.6 so the maximum offset radius should be 0.8 otherwise
some parts of your object will vanish with the negative offset.
Got it ! Thanks for the explanation and for your time helping me with this.
Dan
--
View this message in context: http://forum.openscad.org/Filleting-again-tp20610p20697.html
Sent from the OpenSCAD mailing list archive at Nabble.com.