looooo / freecad.gears

a gear module for freecad
GNU General Public License v3.0
260 stars 98 forks source link

Generated strange worm gear when the height of the gear is greater than 450mm (425mm) #162

Closed StartEndUser closed 7 months ago

StartEndUser commented 7 months ago

shot1 (Left: height=400mm Right: height=500mm)

After generating a worm gear I changed the height to 500mm and it generates a strange stuff.

shot2 (height=425mm) Things started to get weird when the height was about 425mm. But not so obvious.

shot3 (height=450mm) When the height was 450mm. I received an error.

The error was:

21:36:05  Traceback (most recent call last):
  File "/home/SEU/.local/share/FreeCAD/Mod/freecad.gears/./freecad/gears/basegear.py", line 127, in execute
    gear_shape = self.generate_gear_shape(fp)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/SEU/.local/share/FreeCAD/Mod/freecad.gears/./freecad/gears/wormgear.py", line 184, in generate_gear_shape
    shape = helical_extrusion(part.Face(full_wire), h, h * np.tan(beta) * 2 / d)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/SEU/.local/share/FreeCAD/Mod/freecad.gears/./freecad/gears/basegear.py", line 215, in helical_extrusion
    pipe_shell, top_wire = make_pipe(spine, wire)
                           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/SEU/.local/share/FreeCAD/Mod/freecad.gears/./freecad/gears/basegear.py", line 210, in make_pipe
    return (mkPS.shape(), mkPS.lastShape())
            ^^^^^^^^^^^^
<class 'Part.OCCError'>: BRep_API: command not done
21:36:05  Recompute failed!

shot4 (height=455mm) If the height is greater than 450mm. I get the strange worm gear again.

I'm using:

looooo commented 7 months ago

Hmm, I think this is an issue with the geometry library (occt).