Tue, 05/05/2026 - 12:13
Hello, maybe this isn't the right place to write this but I currently face a very weird issue/bug and I think it has to do with the OpenCASCADE kernel modeling, but I would like for someone else to confirm that maybe using another design tool.
I am creating 2 parts and 1 hole: I want to fuse part 1 and part 2 and then cut the hole: DIFFERENCE(UNION(part1, part2), hole). However the result is very clearly not the target geometry.
I attached 2 pictures:
- "compound.png" clearly displays the 3 tools (part1 is the inner revolution piece, part2 is the further away revolution piece with a smaller revolution angle, and the cylinder is the tool I want for making the hole)
- "result.png" is what I get back from applying the operation
I got this result using the Replicad (replicad-cli) interface for OpenCASCADE (https://github.com/sgenoud/replicad).
The code I used can be found below for context.
I tried to make the example as minimal as possible to showcase the issue.
The models are two rectangles sketched on the XZ plane, then translated along x axis, tilted away from the y axis, then revoluted at different angles; and a circle sketched and extruded on the XY plane, and also translated along the x axis and tilted away from the y axis.
I would be grateful if someone could make this piece using a different tool to rule out the possibility that this isn't a kernel bug, and to replicate the bug.
Thank you for letting me know, you can also contact me at: gruvw.dev@gmail.com
```js
/** @typedef { typeof import("replicad") } ReplicadLib */
/** @type {ReplicadLib} */
const { draw, drawCircle, compoundShapes } = replicad;
const main = (_) => {
const height = 5;
const length = 30;
const part1 = draw([0, 0])
.lineTo([0, height])
.lineTo([-length, height])
.lineTo([-length, 0])
.close()
.translate(length)
.rotate(-10, [0, 0, 0], [0, 1, 0])
.sketchOnPlane("XZ")
.revolve([0, 0, 1], { angle: -10 })
const part2 = draw([0, 0])
.lineTo([0, height])
.lineTo([length, height])
.lineTo([length, 0])
.close()
.translate(length)
.rotate(-10, [0, 0, 0], [0, 1, 0])
.sketchOnPlane("XZ")
.revolve([0, 0, 1], { angle: -4 })
const hole = drawCircle(1)
.sketchOnPlane("XY")
.extrude(height)
.translate(length / 2)
.rotate(10, [0, 0, 0], [0, 1, 0])
// Bug: union then difference
return part1.fuse(part2).cut(hole)
// Compound
// return compoundShapes([part1, part2, hole])
}
```