Replies: 1 comment
-
The following example shows the effect of changing the axis of the revolve function. // gyrobal experiment
/** @typedef { typeof import("replicad") } replicadLib */
/** @type {function(replicadLib, typeof defaultParams): any} */
function main(
{
sketchCircle
})
{
let wheelDiameter = 120;
let width = 10;
let height = 10;
let radius = 10;
let filletSpoke = 1.5; // fails if larger than 1.6
let filletWheelSpoke = 3;
// create a large donut by revolving a circle that is placed off-center
let donut = sketchCircle(radius,{plane:"XZ",origin: [wheelDiameter/2,0,0]}).revolve([0,0,1],{origin:[0,0,0]})
let donut2 = sketchCircle(radius,{plane: "XY",origin: [0,wheelDiameter/2,0]}).revolve([1,0,0],{origin:[0,0,0]}).scale(0.99)
return donut.fuse(donut2)
} The example also shows that the boolean function is sensitive to shapes that have coinciding faces. If you try to fuse two rings, the calculation fails. In the example above I have solved this by scaling one of the rings by a factor 0.99. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The following example of a steering wheel shows how to use the revolve function. The standard
revolve()
will revolve a sketch around its origin using the Z-axis. If you want to revolve around the global origin you have to specify this in the function callrevolve([vector], {origin: [point]})
.The shape is also interesting as the fillets in the spoke and between the spoke and the steering wheel have to have the right combination to make it work. The same behaviour is found in CascadeStudio, so it may be assumed that this is not a limitation of Replicad.
In some cases the calculation fails completely, in other cases part of the shapes disappear.
Beta Was this translation helpful? Give feedback.
All reactions