discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: Need help creating a design similar with the pictures

RP
Ronaldo Persiano
Mon, May 9, 2022 5:01 PM

There is no OpenSCAD native operator to get the ramp you intend to model.
You may get the ramp shape using a specific kind of sweep: one that just
translates the sections along a spiral path.

BOSL2 library has the right module to do that. It is called spiral_sweep and
documented here:

https://github.com/revarbat/BOSL2/wiki/skin.scad#functionmodule-spiral_sweep

The code to make your shape might be something like:

height = 20;
poly = move([0,-height/2],difference(
square([7.2,height],center = true),
move([0,height/2,0],circle($fn = 180,  r = 4.5/2))
))[0];
spiral_sweep(poly, h=height, turn=0.5, r=57.5/2, $fn=36);

The polygon calculation above computes a region as the difference() of two
2d shapes and takes the first (the only one) path of it. This polygon might
be computed in other ways.
Certainly, the sweep shape will need to be clipped appropriately.

[image: ramp.PNG]

Em dom., 8 de mai. de 2022 às 21:31, sorin vatasoiu via Discuss <
discuss@lists.openscad.org> escreveu:

---------- Forwarded message ----------
From: sorin vatasoiu svatasoiu@yahoo.com
To: "discuss@lists.openscad.org" discuss@lists.openscad.org
Cc:
Bcc:
Date: Mon, 9 May 2022 00:31:07 +0000 (UTC)
Subject: [OpenSCAD] Need help creating a design similar with the pictures
Hi,

I'm trying to simulate this knob. I can handle everything but the circular
side with a channel on it.

I can do the flat circular side with the channel, but I cannot figure out
how to do the halt side that has an inclination.
the code I have for the side part it is:

$fn = 360;

outsideChannelFlat();
//channelProfile();

module outsideChannelFlat(){
rotate_extrude(angle = 180, convexity = 2) {
translate([57.5/2,0,0])
channelProfile();
}
}

module channelProfile(){
difference(){
square([7.2,16.5],center = false);
translate([7.2/2,16.5,0])
circle($fn = 180,  r = 4.5/2);
}
}

Any help with the inclined part it is welcomed.

Thank you,

Sorin

---------- Forwarded message ----------
From: sorin vatasoiu via Discuss discuss@lists.openscad.org
To: "discuss@lists.openscad.org" discuss@lists.openscad.org
Cc: sorin vatasoiu svatasoiu@yahoo.com
Bcc:
Date: Mon, 9 May 2022 00:31:07 +0000 (UTC)
Subject: [OpenSCAD] Need help creating a design similar with the pictures


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

There is no OpenSCAD native operator to get the ramp you intend to model. You may get the ramp shape using a specific kind of sweep: one that just translates the sections along a spiral path. BOSL2 library has the right module to do that. It is called spiral_sweep and documented here: https://github.com/revarbat/BOSL2/wiki/skin.scad#functionmodule-spiral_sweep The code to make your shape might be something like: height = 20; poly = move([0,-height/2],difference( square([7.2,height],center = true), move([0,height/2,0],circle($fn = 180, r = 4.5/2)) ))[0]; spiral_sweep(poly, h=height, turn=0.5, r=57.5/2, $fn=36); The polygon calculation above computes a region as the difference() of two 2d shapes and takes the first (the only one) path of it. This polygon might be computed in other ways. Certainly, the sweep shape will need to be clipped appropriately. [image: ramp.PNG] Em dom., 8 de mai. de 2022 às 21:31, sorin vatasoiu via Discuss < discuss@lists.openscad.org> escreveu: > > > > ---------- Forwarded message ---------- > From: sorin vatasoiu <svatasoiu@yahoo.com> > To: "discuss@lists.openscad.org" <discuss@lists.openscad.org> > Cc: > Bcc: > Date: Mon, 9 May 2022 00:31:07 +0000 (UTC) > Subject: [OpenSCAD] Need help creating a design similar with the pictures > Hi, > > I'm trying to simulate this knob. I can handle everything but the circular > side with a channel on it. > > I can do the flat circular side with the channel, but I cannot figure out > how to do the halt side that has an inclination. > the code I have for the side part it is: > > $fn = 360; > > outsideChannelFlat(); > //channelProfile(); > > > module outsideChannelFlat(){ > rotate_extrude(angle = 180, convexity = 2) { > translate([57.5/2,0,0]) > channelProfile(); > } > } > > module channelProfile(){ > difference(){ > square([7.2,16.5],center = false); > translate([7.2/2,16.5,0]) > circle($fn = 180, r = 4.5/2); > } > } > > Any help with the inclined part it is welcomed. > > Thank you, > > Sorin > > > > > > > > > > ---------- Forwarded message ---------- > From: sorin vatasoiu via Discuss <discuss@lists.openscad.org> > To: "discuss@lists.openscad.org" <discuss@lists.openscad.org> > Cc: sorin vatasoiu <svatasoiu@yahoo.com> > Bcc: > Date: Mon, 9 May 2022 00:31:07 +0000 (UTC) > Subject: [OpenSCAD] Need help creating a design similar with the pictures > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >