discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Feasibility of Cylindrical Cam (and multipart cuts) in OpenSCAD

T
ThomasB
Sun, Feb 28, 2021 12:17 PM

Hello everyone,

I constructed something with my classic CAD tool and I am thinking of
switching to OpenSCAD. I already took a look at the OpenSCAD cheatsheet and
tutorial. But I have still two questions left and would be very happy if
somebody could help me get a feeling for OpenSCAD:

  1. I have an housing with an axle inside. The axle has cam followers which
    move linearly back and forth forced by the "cam profile" (see blue marked
    region). The profile ensures, that the acceleration on the cam followers is
    quite smooth and does not have high acceleration peaks. Also the walls of
    the cam profile arent 90° to the housing-cylinder but more like 75°, allowin
    http://forum.openscad.org/file/t3142/cam-follower-graph.png
    http://forum.openscad.org/file/t3142/cylinder.png g easy printing with my
    FDM printer.
    -> Is this difficult to design in OpenSCAD? I think I would be able to
    define a formula, describing the linear position of the cam-follower
    depending on the angle of the axle (see greatly drawn graph). But is it very
    difficult to create the cam profile from that formula? It does not need to
    be perfect, but should be at least smooth and have the 75° walls. I have
    several forms that I would like to describe by the angle of the axle, but
    this one is the most difficult.

  2. The system contains many parts that are bolted together. I want to print
    this parts separatly. Is it difficult, or requires redundant logic, to add
    the holes in both parts to bolt them together? E.g. the relevant logic could
    be reduced to: 3 holes on the one side, giving some metrics on where they
    are, mirror (function "mirror"...) to the other side, and put that through
    all relevant parts (as "difference").

Thank you in advance!

BR Thomas

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

Hello everyone, I constructed something with my classic CAD tool and I am thinking of switching to OpenSCAD. I already took a look at the OpenSCAD cheatsheet and tutorial. But I have still two questions left and would be very happy if somebody could help me get a feeling for OpenSCAD: 1. I have an housing with an axle inside. The axle has cam followers which move linearly back and forth forced by the "cam profile" (see blue marked region). The profile ensures, that the acceleration on the cam followers is quite smooth and does not have high acceleration peaks. Also the walls of the cam profile arent 90° to the housing-cylinder but more like 75°, allowin <http://forum.openscad.org/file/t3142/cam-follower-graph.png> <http://forum.openscad.org/file/t3142/cylinder.png> g easy printing with my FDM printer. -> Is this difficult to design in OpenSCAD? I think I would be able to define a formula, describing the linear position of the cam-follower depending on the angle of the axle (see greatly drawn graph). But is it very difficult to create the cam profile from that formula? It does not need to be perfect, but should be at least smooth and have the 75° walls. I have several forms that I would like to describe by the angle of the axle, but this one is the most difficult. 2. The system contains many parts that are bolted together. I want to print this parts separatly. Is it difficult, or requires redundant logic, to add the holes in both parts to bolt them together? E.g. the relevant logic could be reduced to: 3 holes on the one side, giving some metrics on where they are, mirror (function "mirror"...) to the other side, and put that through all relevant parts (as "difference"). Thank you in advance! BR Thomas -- Sent from: http://forum.openscad.org/
RP
Ronaldo Persiano
Sun, Feb 28, 2021 6:27 PM

I can't say I understand your task model, I am not a mechanical engineer.
If you send images of the parts you have modeled with your "classic CAD",
it is possible you get some help from people here.

Em dom., 28 de fev. de 2021 às 12:17, ThomasB Thom@sbus.ch escreveu:

Hello everyone,

I constructed something with my classic CAD tool and I am thinking of
switching to OpenSCAD. I already took a look at the OpenSCAD cheatsheet and
tutorial. But I have still two questions left and would be very happy if
somebody could help me get a feeling for OpenSCAD:

  1. I have an housing with an axle inside. The axle has cam followers which
    move linearly back and forth forced by the "cam profile" (see blue marked
    region). The profile ensures, that the acceleration on the cam followers is
    quite smooth and does not have high acceleration peaks. Also the walls of
    the cam profile arent 90° to the housing-cylinder but more like 75°, allowin[image:
    cam follower graph][image: cylindrical housing]g easy printing with my
    FDM printer.
    -> Is this difficult to design in OpenSCAD? I think I would be able to
    define a formula, describing the linear position of the cam-follower
    depending on the angle of the axle (see greatly drawn graph). But is it
    very difficult to create the cam profile from that formula? It does not
    need to be perfect, but should be at least smooth and have the 75° walls. I
    have several forms that I would like to describe by the angle of the axle,
    but this one is the most difficult.

  2. The system contains many parts that are bolted together. I want to
    print this parts separatly. Is it difficult, or requires redundant logic,
    to add the holes in both parts to bolt them together? E.g. the relevant
    logic could be reduced to: 3 holes on the one side, giving some metrics on
    where they are, mirror (function "mirror"...) to the other side, and put
    that through all relevant parts (as "difference").

Thank you in advance!

BR Thomas

Sent from the OpenSCAD mailing list archive http://forum.openscad.org/
at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I can't say I understand your task model, I am not a mechanical engineer. If you send images of the parts you have modeled with your "classic CAD", it is possible you get some help from people here. Em dom., 28 de fev. de 2021 às 12:17, ThomasB <Thom@sbus.ch> escreveu: > Hello everyone, > > I constructed something with my classic CAD tool and I am thinking of > switching to OpenSCAD. I already took a look at the OpenSCAD cheatsheet and > tutorial. But I have still two questions left and would be very happy if > somebody could help me get a feeling for OpenSCAD: > > 1. I have an housing with an axle inside. The axle has cam followers which > move linearly back and forth forced by the "cam profile" (see blue marked > region). The profile ensures, that the acceleration on the cam followers is > quite smooth and does not have high acceleration peaks. Also the walls of > the cam profile arent 90° to the housing-cylinder but more like 75°, allowin[image: > cam follower graph][image: cylindrical housing]g easy printing with my > FDM printer. > -> Is this difficult to design in OpenSCAD? I think I would be able to > define a formula, describing the linear position of the cam-follower > depending on the angle of the axle (see greatly drawn graph). But is it > very difficult to create the cam profile from that formula? It does not > need to be perfect, but should be at least smooth and have the 75° walls. I > have several forms that I would like to describe by the angle of the axle, > but this one is the most difficult. > > 2. The system contains many parts that are bolted together. I want to > print this parts separatly. Is it difficult, or requires redundant logic, > to add the holes in both parts to bolt them together? E.g. the relevant > logic could be reduced to: 3 holes on the one side, giving some metrics on > where they are, mirror (function "mirror"...) to the other side, and put > that through all relevant parts (as "difference"). > > Thank you in advance! > > BR Thomas > ------------------------------ > Sent from the OpenSCAD mailing list archive <http://forum.openscad.org/> > at Nabble.com. > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
A
adrianv
Sun, Feb 28, 2021 7:59 PM

I think if you have a functional relationship describing what you need to do
then OpenSCAD will be a good tool for the job.  You may, however, have to
use polyhedron() or some helper function from a library that calls
polyhedron in order to make the shape you need.  As Ronaldo says, we don't
really have enough information to understand your part.  Is there a track
inside the band that we see around the outside?  What does a cross section
look like?

Maybe somebody has a clever way to do this without using polyhedrons, but
here is how something that maybe (?) resembles your intention can be done
using skin() from the BOSL2 library.  (Somebody else can show a fully
primitive version with all the book keeping on display.)  I have made the
band that circles the cylinder follow a functional relationship.  You can
put in the right function there....  I made the outermost width of the band
narrower than the inner width.  You could substitute an angle instead.  If
there is supposed to be a track on the inside it will need to be separately
created and differenced() from the model.

https://github.com/revarbat/BOSL2/wiki/skin.scad

function f(x) = 30+50* (xx(x-360)(x-360)+180180)/(pow(180,4)+180*180);

include<BOSL2/std.scad>
include<BOSL2/skin.scad>
r=30;
r2=35;
width1=15;
width2=8;
wall=4;

profiles = [for(theta=[0:3:360])
[
[rcos(theta), rsin(theta), f(theta)-width1/2],
[rcos(theta), rsin(theta), f(theta)+width1/2],
[r2cos(theta), r2sin(theta), f(theta)+width2/2],
[r2cos(theta), r2sin(theta), f(theta)-width2/2]
]
];
difference(){
cylinder(r=r, l=100, $fn=64);
cylinder(r=r-wall, l=101, $fn=64);
}
skin(profiles, slices=0);

http://forum.openscad.org/file/t2477/thing4.png

Ronaldo wrote

I can't say I understand your task model, I am not a mechanical engineer.
If you send images of the parts you have modeled with your "classic CAD",
it is possible you get some help from people here.

Em dom., 28 de fev. de 2021 às 12:17, ThomasB <

Thom@

> escreveu:

Hello everyone,

I constructed something with my classic CAD tool and I am thinking of
switching to OpenSCAD. I already took a look at the OpenSCAD cheatsheet
and
tutorial. But I have still two questions left and would be very happy if
somebody could help me get a feeling for OpenSCAD:

  1. I have an housing with an axle inside. The axle has cam followers
    which
    move linearly back and forth forced by the "cam profile" (see blue marked
    region). The profile ensures, that the acceleration on the cam followers
    is
    quite smooth and does not have high acceleration peaks. Also the walls of
    the cam profile arent 90° to the housing-cylinder but more like 75°,
    allowin[image:
    cam follower graph][image: cylindrical housing]g easy printing with my
    FDM printer.
    -> Is this difficult to design in OpenSCAD? I think I would be able to
    define a formula, describing the linear position of the cam-follower
    depending on the angle of the axle (see greatly drawn graph). But is it
    very difficult to create the cam profile from that formula? It does not
    need to be perfect, but should be at least smooth and have the 75° walls.
    I
    have several forms that I would like to describe by the angle of the
    axle,
    but this one is the most difficult.

  2. The system contains many parts that are bolted together. I want to
    print this parts separatly. Is it difficult, or requires redundant logic,
    to add the holes in both parts to bolt them together? E.g. the relevant
    logic could be reduced to: 3 holes on the one side, giving some metrics
    on
    where they are, mirror (function "mirror"...) to the other side, and put
    that through all relevant parts (as "difference").

Thank you in advance!

BR Thomas

Sent from the OpenSCAD mailing list archive
<http://forum.openscad.org/>
at Nabble.com.


OpenSCAD mailing list

Discuss@.openscad

Discuss@.openscad

I think if you have a functional relationship describing what you need to do then OpenSCAD will be a good tool for the job. You may, however, have to use polyhedron() or some helper function from a library that calls polyhedron in order to make the shape you need. As Ronaldo says, we don't really have enough information to understand your part. Is there a track inside the band that we see around the outside? What does a cross section look like? Maybe somebody has a clever way to do this without using polyhedrons, but here is how something that maybe (?) resembles your intention can be done using skin() from the BOSL2 library. (Somebody else can show a fully primitive version with all the book keeping on display.) I have made the band that circles the cylinder follow a functional relationship. You can put in the right function there.... I made the outermost width of the band narrower than the inner width. You could substitute an angle instead. If there is supposed to be a track on the inside it will need to be separately created and differenced() from the model. https://github.com/revarbat/BOSL2/wiki/skin.scad function f(x) = 30+50* (x*x*(x-360)*(x-360)+180*180)/(pow(180,4)+180*180); include<BOSL2/std.scad> include<BOSL2/skin.scad> r=30; r2=35; width1=15; width2=8; wall=4; profiles = [for(theta=[0:3:360]) [ [r*cos(theta), r*sin(theta), f(theta)-width1/2], [r*cos(theta), r*sin(theta), f(theta)+width1/2], [r2*cos(theta), r2*sin(theta), f(theta)+width2/2], [r2*cos(theta), r2*sin(theta), f(theta)-width2/2] ] ]; difference(){ cylinder(r=r, l=100, $fn=64); cylinder(r=r-wall, l=101, $fn=64); } skin(profiles, slices=0); <http://forum.openscad.org/file/t2477/thing4.png> Ronaldo wrote > I can't say I understand your task model, I am not a mechanical engineer. > If you send images of the parts you have modeled with your "classic CAD", > it is possible you get some help from people here. > > Em dom., 28 de fev. de 2021 às 12:17, ThomasB &lt; > Thom@ > &gt; escreveu: > >> Hello everyone, >> >> I constructed something with my classic CAD tool and I am thinking of >> switching to OpenSCAD. I already took a look at the OpenSCAD cheatsheet >> and >> tutorial. But I have still two questions left and would be very happy if >> somebody could help me get a feeling for OpenSCAD: >> >> 1. I have an housing with an axle inside. The axle has cam followers >> which >> move linearly back and forth forced by the "cam profile" (see blue marked >> region). The profile ensures, that the acceleration on the cam followers >> is >> quite smooth and does not have high acceleration peaks. Also the walls of >> the cam profile arent 90° to the housing-cylinder but more like 75°, >> allowin[image: >> cam follower graph][image: cylindrical housing]g easy printing with my >> FDM printer. >> -> Is this difficult to design in OpenSCAD? I think I would be able to >> define a formula, describing the linear position of the cam-follower >> depending on the angle of the axle (see greatly drawn graph). But is it >> very difficult to create the cam profile from that formula? It does not >> need to be perfect, but should be at least smooth and have the 75° walls. >> I >> have several forms that I would like to describe by the angle of the >> axle, >> but this one is the most difficult. >> >> 2. The system contains many parts that are bolted together. I want to >> print this parts separatly. Is it difficult, or requires redundant logic, >> to add the holes in both parts to bolt them together? E.g. the relevant >> logic could be reduced to: 3 holes on the one side, giving some metrics >> on >> where they are, mirror (function "mirror"...) to the other side, and put >> that through all relevant parts (as "difference"). >> >> Thank you in advance! >> >> BR Thomas >> ------------------------------ >> Sent from the OpenSCAD mailing list archive >> &lt;http://forum.openscad.org/&gt; >> at Nabble.com. >> _______________________________________________ >> OpenSCAD mailing list >> > Discuss@.openscad >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > > _______________________________________________ > OpenSCAD mailing list > Discuss@.openscad > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Sent from: http://forum.openscad.org/
T
ThomasB
Sun, Feb 28, 2021 9:40 PM

adrianv and ronaldo, thank you very much!
You even provided me with the complete solution! This demonstrates me, that
with some experience in OpenSCAD I should be able to design my stuff.
This answer is totaly sufficient, I will start now learning OpenSCAD, again,
thank you!

And yes, there is a track inside, and with your code I should be able to
write a solution to hollow that band. :)

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

adrianv and ronaldo, thank you very much! You even provided me with the complete solution! This demonstrates me, that with some experience in OpenSCAD I should be able to design my stuff. This answer is totaly sufficient, I will start now learning OpenSCAD, again, thank you! And yes, there is a track inside, and with your code I should be able to write a solution to hollow that band. :) -- Sent from: http://forum.openscad.org/