OpenSCAD - Cylinder from axis
How can I create this shape? The depicted shape can be interpreted as one of the following:
- A cone that comes to a line instead of a point.
- A loft from a circle to a straight line.
- A loft from a circle to a square of [0,1].
- A cylinder with one side squeezed in.
-- The curve on the face of the circle would be ideal for accuracy, but not strictly necessary.
Approximation in OpenSCAD using this code:
Shape achieved in Fusion360:
openscad
add a comment |
How can I create this shape? The depicted shape can be interpreted as one of the following:
- A cone that comes to a line instead of a point.
- A loft from a circle to a straight line.
- A loft from a circle to a square of [0,1].
- A cylinder with one side squeezed in.
-- The curve on the face of the circle would be ideal for accuracy, but not strictly necessary.
Approximation in OpenSCAD using this code:
Shape achieved in Fusion360:
openscad
add a comment |
How can I create this shape? The depicted shape can be interpreted as one of the following:
- A cone that comes to a line instead of a point.
- A loft from a circle to a straight line.
- A loft from a circle to a square of [0,1].
- A cylinder with one side squeezed in.
-- The curve on the face of the circle would be ideal for accuracy, but not strictly necessary.
Approximation in OpenSCAD using this code:
Shape achieved in Fusion360:
openscad
How can I create this shape? The depicted shape can be interpreted as one of the following:
- A cone that comes to a line instead of a point.
- A loft from a circle to a straight line.
- A loft from a circle to a square of [0,1].
- A cylinder with one side squeezed in.
-- The curve on the face of the circle would be ideal for accuracy, but not strictly necessary.
Approximation in OpenSCAD using this code:
Shape achieved in Fusion360:
openscad
openscad
asked Nov 20 '18 at 18:38
wizuluswizulus
1,39311125
1,39311125
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You can simply extrude a circle and scale it over the length of extrusion to a flat line. The scale-parameter s. documentation
of linear_extrude can be a scalar or a vector with x- and y-scale-factor. Set one of them to 1 and the other to 0:
$fs = 0.01;
$fa = 0.01;
linear_extrude(height = 15, scale =[0, 1]) circle(d = 10);
The result:
add a comment |
I learned you can do a convex loft using hull.
module pinch(h=1,r1=1,r2=1,r3=0) {
zero = 0.00000000001;
steps = $fn ? $fn : $fa;
res = h/steps;
r1 = r1 ? r1 : res;
r2 = r2 ? r2 : res;
r3 = r3 ? r3 : zero;
hull() {
cylinder(h=zero,r=r1,r2=res,r3=0,center=false);
translate([-r2, -r3, h - zero]) cube([
r2 * 2,
r3 * 2,
zero
]);
}
}
translate([1,0,.5]) rotate([0,-90,0]) pinch(1, .5, .5, $fn=50);
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53399434%2fopenscad-cylinder-from-axis%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can simply extrude a circle and scale it over the length of extrusion to a flat line. The scale-parameter s. documentation
of linear_extrude can be a scalar or a vector with x- and y-scale-factor. Set one of them to 1 and the other to 0:
$fs = 0.01;
$fa = 0.01;
linear_extrude(height = 15, scale =[0, 1]) circle(d = 10);
The result:
add a comment |
You can simply extrude a circle and scale it over the length of extrusion to a flat line. The scale-parameter s. documentation
of linear_extrude can be a scalar or a vector with x- and y-scale-factor. Set one of them to 1 and the other to 0:
$fs = 0.01;
$fa = 0.01;
linear_extrude(height = 15, scale =[0, 1]) circle(d = 10);
The result:
add a comment |
You can simply extrude a circle and scale it over the length of extrusion to a flat line. The scale-parameter s. documentation
of linear_extrude can be a scalar or a vector with x- and y-scale-factor. Set one of them to 1 and the other to 0:
$fs = 0.01;
$fa = 0.01;
linear_extrude(height = 15, scale =[0, 1]) circle(d = 10);
The result:
You can simply extrude a circle and scale it over the length of extrusion to a flat line. The scale-parameter s. documentation
of linear_extrude can be a scalar or a vector with x- and y-scale-factor. Set one of them to 1 and the other to 0:
$fs = 0.01;
$fa = 0.01;
linear_extrude(height = 15, scale =[0, 1]) circle(d = 10);
The result:
answered Nov 21 '18 at 20:02
a_manthey_67a_manthey_67
2,5901817
2,5901817
add a comment |
add a comment |
I learned you can do a convex loft using hull.
module pinch(h=1,r1=1,r2=1,r3=0) {
zero = 0.00000000001;
steps = $fn ? $fn : $fa;
res = h/steps;
r1 = r1 ? r1 : res;
r2 = r2 ? r2 : res;
r3 = r3 ? r3 : zero;
hull() {
cylinder(h=zero,r=r1,r2=res,r3=0,center=false);
translate([-r2, -r3, h - zero]) cube([
r2 * 2,
r3 * 2,
zero
]);
}
}
translate([1,0,.5]) rotate([0,-90,0]) pinch(1, .5, .5, $fn=50);
add a comment |
I learned you can do a convex loft using hull.
module pinch(h=1,r1=1,r2=1,r3=0) {
zero = 0.00000000001;
steps = $fn ? $fn : $fa;
res = h/steps;
r1 = r1 ? r1 : res;
r2 = r2 ? r2 : res;
r3 = r3 ? r3 : zero;
hull() {
cylinder(h=zero,r=r1,r2=res,r3=0,center=false);
translate([-r2, -r3, h - zero]) cube([
r2 * 2,
r3 * 2,
zero
]);
}
}
translate([1,0,.5]) rotate([0,-90,0]) pinch(1, .5, .5, $fn=50);
add a comment |
I learned you can do a convex loft using hull.
module pinch(h=1,r1=1,r2=1,r3=0) {
zero = 0.00000000001;
steps = $fn ? $fn : $fa;
res = h/steps;
r1 = r1 ? r1 : res;
r2 = r2 ? r2 : res;
r3 = r3 ? r3 : zero;
hull() {
cylinder(h=zero,r=r1,r2=res,r3=0,center=false);
translate([-r2, -r3, h - zero]) cube([
r2 * 2,
r3 * 2,
zero
]);
}
}
translate([1,0,.5]) rotate([0,-90,0]) pinch(1, .5, .5, $fn=50);
I learned you can do a convex loft using hull.
module pinch(h=1,r1=1,r2=1,r3=0) {
zero = 0.00000000001;
steps = $fn ? $fn : $fa;
res = h/steps;
r1 = r1 ? r1 : res;
r2 = r2 ? r2 : res;
r3 = r3 ? r3 : zero;
hull() {
cylinder(h=zero,r=r1,r2=res,r3=0,center=false);
translate([-r2, -r3, h - zero]) cube([
r2 * 2,
r3 * 2,
zero
]);
}
}
translate([1,0,.5]) rotate([0,-90,0]) pinch(1, .5, .5, $fn=50);
answered Nov 20 '18 at 19:59
wizuluswizulus
1,39311125
1,39311125
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53399434%2fopenscad-cylinder-from-axis%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown