CadQuery / CadQuery/cadquery

Sketch. Max possible fillet fails when multiple faces are present.

Open
#1,952 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5.8k
Forks
541
Avg merge
3d 2h
Merged PRs (30d)
5

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'.

Image

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 (.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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.