Open Zdong104 opened 1 month ago
Gears have traditionally been hard to do correctly (issue for context on CadQuery and gears). I did not contribute the gear plugin, so I'm not familiar with it. You could try calling close()
on teeths
on line 95 before trying to extrude. If there is just one last missing segment to close , that will usually fix it. However, if each of the 2D tooth profiles has gaps between them, calling close()
will not fix those.
Potentially related CadQuery PR.
I am trying to run the example code from the cylindrical_gear.py but get the error as below, if there is any solution I can solve this and make it start running?:
Using port 3939 taken from config file Jupyter console not installed Traceback (most recent call last): File "/Users/zihan/Desktop/LLM4CAD/Dataset/IncorrectExamples/cylindrical_gear.py", line 135, in
gear2 = cylindrical_gear(m,z2,alpha,b).val().move(cq.Location(cq.Vector(mz1/2+mz2/2,0,0)))
File "/Users/zihan/Desktop/LLM4CAD/Dataset/IncorrectExamples/cylindrical_gear.py", line 103, in cylindrical_gear
teeths = teeths.extrude(b)
File "/Users/zihan/miniconda3/envs/ml4t/lib/python3.10/site-packages/cadquery/cq.py", line 3149, in extrude
r = self._extrude(until, both=both, taper=taper, upToFace=None)
File "/Users/zihan/miniconda3/envs/ml4t/lib/python3.10/site-packages/cadquery/cq.py", line 3782, in _extrude
faces = self._getFaces()
File "/Users/zihan/miniconda3/envs/ml4t/lib/python3.10/site-packages/cadquery/cq.py", line 3730, in _getFaces
rv.extend(wiresToFaces(self.ctx.popPendingWires()))
File "/Users/zihan/miniconda3/envs/ml4t/lib/python3.10/site-packages/cadquery/occ_impl/shapes.py", line 4167, in wiresToFaces
return Face.makeFromWires(wireList[0], wireList[1:]).Faces()
File "/Users/zihan/miniconda3/envs/ml4t/lib/python3.10/site-packages/cadquery/occ_impl/shapes.py", line 2856, in makeFromWires
raise ValueError("Cannot build face(s): outer wire is not closed")
ValueError: Cannot build face(s): outer wire is not closed