-
Notifications
You must be signed in to change notification settings - Fork 396
Description
Hi.
I want to put known max fillet on a rectangle edge. It works correctly on a single rectangle. But fails if there are multiple 'rectangle instances'.
Looks like it does not matter how they were created. Ive tried cutting one bigger rectangle in two via subtract mode, pushing multiple points, drawing segments and assembling manually.
One curious remark is that even when single point is pushed, if its not (0,0) max fillet on a rectangle breaks.
import cadquery as cq
#from ocp_vscode import (reset_show, show_object, Camera)
#reset_show()
W = 1 # big rectangle width. for cutting
L = 2 # rectangle height/length
gap = W/5 # gap between rectangle
W_1 = (W - gap)/2 # split rectangle width
r = W_1/2 # half-width = fillet radius
# push one point
sk = cq.Sketch().push([(0,0)]).rect(W_1, L).reset() # fillet is done
sk = cq.Sketch().push([(1,0)]).rect(W_1, L).reset() # fails on fillet
sk.vertices('>Y').fillet(r).reset() # fail
#show_object(sk , name= '1pt' , grid = True, reset_camera = Camera.KEEP)
# 2 faces via subtract
sk = cq.Sketch().rect(W, L).reset()
sk.rect(gap, 1.5*L, mode='s').reset() # cut vertical gap via 'subtract'
sk.vertices('>Y').fillet(r).reset() # fail
#show_object(sk , name= 'bool' , grid = True, reset_camera = Camera.KEEP)
# cut out two slots
sk= cq.Sketch().rect(2*W, 1.05*L)
sk.push([(-0.5,0), (0.5,0)]).rect(W_1,L,mode='s', tag = 'aa') # cut slots, remember verts
sk.vertices(tag='aa').fillet(r) # fail
#show_object(sk , name= 'slots' , grid = True, reset_camera = Camera.KEEP)
What are the options of fixing this behavior? As a short-time solution, maybe iterating/mapping fillet onto separate faces? doing r *= 0.9999 and 'cleaning' close-by points?
Yes, it is possible to reduce radius slightly and then everything goes through. But i would prefer a clean, high-level solution.
Last two entries of a trace:
File c:\Repos\venvs\cadquery\venv\Lib\site-packages\cadquery\sketch.py:616, in <genexpr>(.0)
609 """
610 Add a fillet based on current selection.
611 """
613 f2v = self._matchFacesToVertices()
615 self._faces = Compound.makeCompound(
--> [616](file:///C:/Repos/venvs/cadquery/venv/Lib/site-packages/cadquery/sketch.py:616) k.fillet2D(d, v) if v else k for k, v in f2v.items()
617 )
619 return self
File c:\Repos\venvs\cadquery\venv\Lib\site-packages\cadquery\occ_impl\shapes.py:3472, in Face.fillet2D(self, radius, vertices)
3468 fillet_builder.AddFillet(v.wrapped, radius)
3470 fillet_builder.Build()
-> [3472](file:///C:/Repos/venvs/cadquery/venv/Lib/site-packages/cadquery/occ_impl/shapes.py:3472) return self.__class__(fillet_builder.Shape())
StdFail_NotDone: BRep_API: command not done