Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions packages/modeling/src/operations/extrusions/extrudeRotate.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,9 @@ const extrudeRotate = (options, geometry) => {

const rotationPerSlice = totalRotation / segments
const isCapped = Math.abs(totalRotation) < TAU
const baseSlice = slice.fromSides(geom2.toSides(geometry))
const baseSlice = slice.transform(mat4.fromXRotation(mat4.create(), TAU / 4), slice.fromSides(geom2.toSides(geometry)))
Comment thread
z3dev marked this conversation as resolved.
Resolved
slice.reverse(baseSlice, baseSlice)

const matrix = mat4.create()
const xRotationMatrix = mat4.fromXRotation(mat4.create(), TAU / 4) // compute once, reuse
const zRotationMatrix = mat4.create() // reuse for Z rotation
const createSlice = (progress, index, base) => {
let Zrotation = rotationPerSlice * index + startAngle
Expand All @@ -123,9 +121,8 @@ const extrudeRotate = (options, geometry) => {
Zrotation = startAngle
}
mat4.fromZRotation(zRotationMatrix, Zrotation)
mat4.multiply(matrix, zRotationMatrix, xRotationMatrix)

return slice.transform(matrix, base)
return slice.transform(zRotationMatrix, base)
}

options = {
Expand Down
Loading