-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cutting a fused shape shows only edges #93
Comments
I suspected that the character "e" could be the culprit, but this seems not the case. A simple workaround is to extrude the shapes first before performing the cut. const {draw, drawRectangle, drawCircle, drawText} = replicad
const main = (r) => {
function center(drawing) {
const boundingBox = drawing.boundingBox;
drawing = drawing.translate(-boundingBox.center[0], -boundingBox.center[1]);
return drawing;
}
let plate = drawRectangle(5, 5).sketchOnPlane("XY").extrude(0.2)
let cutter = drawCircle(0.5).fuse(center(drawText('test', { fontSize: 2 })).translate(0, 0.8).rotate(90))
cutter = cutter.sketchOnPlane("XY").extrude(1.0);
plate = plate.cut(cutter)
return plate;
}; |
Just doodling ... single characters work fine, but multiple characters fail. Perhaps a relation with an earlier issue #50 ? const {draw, drawRectangle, drawCircle, drawText} = replicad
const main = (r) => {
function center(drawing) {
const boundingBox = drawing.boundingBox;
drawing = drawing.translate(-boundingBox.center[0], -boundingBox.center[1]);
return drawing;
}
let text = drawText( '0',{fontSize : 8}).translate([0,4]);
let text2 = drawText( 'experiment',{fontSize : 8}).translate([-17,-4])
let plate = drawRectangle(60, 40).cut(text).cut(text2);
return plate.sketchOnPlane('XY').extrude(0.2);
}; |
Cutting 3d shapes is performed by calling OCCT methods, 2d boolean ops are implemented in JS (based on my limited experience with replicad codebase and bug reports). |
Thank you for your response. I've explored the option of cutting after extrusion for this particular scenario, and while it may not be the optimal solution for my project, it serves as a viable workaround for the time being. Your assistance is greatly appreciated. |
I confirm the whole issue - and I have been working on a better solution for 2D booleans (which can be faster) - but nothing that I would recommend yet unfortunately. |
When trying the code below to cutout a fused circle with text it only show the edges of the fused shape instead of it being cut.
This also happens when only using a to be cutout when using this code:
The text was updated successfully, but these errors were encountered: