8 identical Slots, Can't create path for two of them

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
acp693
Posts: 127
Joined: Wed Dec 15, 2021 7:41 pm

8 identical Slots, Can't create path for two of them

Post by acp693 »

I've been puzzling over this the whole afternoon and can't figure it out. I have a board with 8 slots in it. I can calculate a path for 6, 2 won't calculate. I receive the following error message:

Code: Select all

17:40:56  Traceback (most recent call last):
  File "C:\Users\PA\Downloads\FreeCAD_weekly-builds-31109-2022-11-27-conda-Windows-x86_64-py310\Mod\Path\PathScripts\PathUtils.py", line 70, in new_function
    res = function(*args, **kwargs)
  File "C:\Users\\PA\Downloads\FreeCAD_weekly-builds-31109-2022-11-27-conda-Windows-x86_64-py310\Mod\Path\Path\Op\Base.py", line 817, in execute
    result = self.opExecute(obj)
  File "C:\Users\\PA\Downloads\FreeCAD_weekly-builds-31109-2022-11-27-conda-Windows-x86_64-py310\Mod\Path\Path\Op\Area.py", line 363, in opExecute
    for shp in self.areaOpShapes(obj):
  File "C:\Users\\PA\Downloads\FreeCAD_weekly-builds-31109-2022-11-27-conda-Windows-x86_64-py310\Mod\Path\Path\Op\Profile.py", line 413, in areaOpShapes
    shapes.extend(self._processEdges(obj, remainingObjBaseFeatures))
  File "C:\Users\\PA\Downloads\FreeCAD_weekly-builds-31109-2022-11-27-conda-Windows-x86_64-py310\Mod\Path\Path\Op\Profile.py", line 618, in _processEdges
    cutWireObjs = self._extractPathWire(
  File "C:\Users\\PA\Downloads\FreeCAD_weekly-builds-31109-2022-11-27-conda-Windows-x86_64-py310\Mod\Path\Path\Op\Profile.py", line 1032, in _extractPathWire
    distToPart0 = self._distMidToMid(wire.Wires[0], part0.Wires[0])
  File "C:\Users\\PA\Downloads\FreeCAD_weekly-builds-31109-2022-11-27-conda-Windows-x86_64-py310\Mod\Path\Path\Op\Profile.py", line 1440, in _distMidToMid
    mpB = self._findWireMidpoint(wireB)
  File "C:\Users\\PA\Downloads\FreeCAD_weekly-builds-31109-2022-11-27-conda-Windows-x86_64-py310\Mod\Path\Path\Op\Profile.py", line 1455, in _findWireMidpoint
    midPnt = E.valueAt(E.getParameterByLength(dtm))
<class 'ValueError'>: value out of range
17:40:56  Recompute failed! Please check report view.
Any ideas on how to get around this? Many thanks.

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.31109 (Git)
Build type: Release
Branch: master
Hash: c23ee7ad88433a0f00e84afae0a62fe738be0c09
Python 3.10.8, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: German/Germany (de_DE)
Installed mods: 
  * CurvedShapes 1.0.4
  * Curves 0.5.3
  * FeedsAndSpeeds 0.4.0
  * Marz 0.0.26-alpha
  * Silk 1.0.0
Attachments
Board.FCStd
(263.19 KiB) Downloaded 16 times
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: 8 identical Slots, Can't create path for two of them

Post by GeneFC »

The slots are not identical. Some have very small line segments at the open ends. That is where the problem occurs. I deleted all selections and then reselected all the edges. Everything worked except one of those tiny segments, Edge 180.

Why so complicated? This is a simple shape and you seem to use all sort of weird construction techniques to make the model.

Gene
acp693
Posts: 127
Joined: Wed Dec 15, 2021 7:41 pm

Re: 8 identical Slots, Can't create path for two of them

Post by acp693 »

Gene, thank you. I’m self taught, that’s probably why I’m not using optimal ways to do this. What would be a better approach?

Thanks again
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: 8 identical Slots, Can't create path for two of them

Post by GeneFC »

acp693 wrote: Sat Dec 03, 2022 7:26 am What would be a better approach?
I would use Part Design rather than drawing all those individual lines and trying to combine everything.

Here is a very quick example. A couple of sketches and a couple of pockets.

Of course you will want to add multiple instances, and you will want to set the correct dimensions.

If you need further help just ask.

PD_Board.FCStd
(27.54 KiB) Downloaded 18 times

Gene
acp693
Posts: 127
Joined: Wed Dec 15, 2021 7:41 pm

Re: 8 identical Slots, Can't create path for two of them

Post by acp693 »

Gene, Thank you very much for taking the time to do this, it's really kind of you! After I read your previous reply, I thought a lot about what you said and how I could make the part more efficiently. I did redraw the board using draft sketches and extruded them in Part WB, then used the array function in Draft to copy them into the correct places, then booleaned them to create the slots. The result was a lot cleaner and with a lot less lines, and I didn't have any subsequent problems calculating paths, but I see your method is yet more refined. The board has now been milled. Have to start using the Part design WB! Thanks again!
Post Reply