Skip to content

Scale parameter for linearExtrude #1140

Answered by hrgdavor
abejfehr asked this question in Q&A
Discussion options

You must be logged in to vote

there is no such option in extrudeLinear, but a utilit func can be made using extrudeFromSlices

const jscad = require('@jscad/modeling')
const {transform, translate, scale} = jscad.transforms
const {circle} = jscad.primitives
const {geom2} = jscad.geometries
const {mat4} = jscad.maths
const {extrudeFromSlices, extrudeLinear, slice} = jscad.extrusions

// extrudeFromSlices is complicated, especially because of usage of slices
function extrudeLinerScaled({height=1,scaleTop=1}, base){
  const callback = (progress,index)=>{
    let localshape = base
    if(index> 0) localshape = scale([scaleTop,scaleTop,scaleTop],base)
    const shape = slice.fromSides(geom2.toSides(localshape))
    const out =

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@abejfehr
Comment options

Comment options

You must be logged in to vote
1 reply
@abejfehr
Comment options

Answer selected by abejfehr
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants