Unable to Sweep in Path WB

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
browntoastjam
Posts: 37
Joined: Fri Aug 20, 2021 9:51 pm

Unable to Sweep in Path WB

Post by browntoastjam »

Hello All,
I have a Bspline path and a sketch object.
I tried to sweep the sketch along the path and can't seem to do it.
The error is "BRepFill_Sweep::BuildEdge"
Screenshot_2022-11-26_13-57-56.png
Screenshot_2022-11-26_13-57-56.png (8.91 KiB) Viewed 647 times

I have attached a MWE with this post.

Any ideas what I am doing wrong?

Code: Select all

OS: Ubuntu 20.04.5 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.21.31097 (Git) AppImage
Build type: Release
Branch: master
Hash: ccf074008774f1bdfed8fec09ed60e2c0fe77cae
Python 3.10.8, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4 0.12.3
  * fasteners 0.3.50
  * sheetmetal 0.2.54
  * Defeaturing
  * Curves 0.5.2
  * Behave-Dark-Colors 0.1.1
  * Assembly3 0.11.3
  * kicadStepUpMod 10.16.5
  * PieMenu
  * ProDarkThemePreferencePack 1.0.0

Thanks.

EDIT: Uploaded file again.
Attachments
testcablewrap.FCStd
(7.67 KiB) Downloaded 9 times
Last edited by browntoastjam on Sat Nov 26, 2022 8:59 pm, edited 2 times in total.
drmacro
Veteran
Posts: 8979
Joined: Sun Mar 02, 2014 4:35 pm

Re: Unable to Sweep in Path WB

Post by drmacro »

Empty file..
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
drmacro
Veteran
Posts: 8979
Joined: Sun Mar 02, 2014 4:35 pm

Re: Unable to Sweep in Path WB

Post by drmacro »

Are you trying to do something like this?
Snip macro screenshot-110475.png
Snip macro screenshot-110475.png (53.97 KiB) Viewed 620 times
There is a handy macro by @mario52 in this thread that makes it pretty easy.
https://forum.freecadweb.org/viewtopic. ... 9&start=40
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
browntoastjam
Posts: 37
Joined: Fri Aug 20, 2021 9:51 pm

Re: Unable to Sweep in Path WB

Post by browntoastjam »

drmacro wrote: Sat Nov 26, 2022 8:10 pmEmpty file..
Sorry. Don't know how that happened.
Re-attaching
Attachments
testcablewrap.FCStd
(7.67 KiB) Downloaded 14 times
browntoastjam
Posts: 37
Joined: Fri Aug 20, 2021 9:51 pm

Re: Unable to Sweep in Path WB

Post by browntoastjam »

drmacro wrote: Sat Nov 26, 2022 8:22 pm Are you trying to do something like this?

Snip macro screenshot-110475.png

There is a handy macro by @mario52 in this thread that makes it pretty easy.
https://forum.freecadweb.org/viewtopic. ... 9&start=40
The sweep path isn't as complicated as that.
There are 30 points in the b-spline.
I tried to make another bspline with fewer control points and that seems to sweep fine.
chrisb
Veteran
Posts: 54177
Joined: Tue Mar 17, 2015 9:14 am

Re: Unable to Sweep in Path WB

Post by chrisb »

When I remove the last point the sweep sort of succeeds and shows a rather weird shape, so I guess it is something with the B-spline.
Attachments
SnipScreenshot-b1d70b.png
SnipScreenshot-b1d70b.png (20.97 KiB) Viewed 511 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
browntoastjam
Posts: 37
Joined: Fri Aug 20, 2021 9:51 pm

Re: Unable to Sweep in Path WB

Post by browntoastjam »

chrisb wrote: Sun Nov 27, 2022 12:14 am When I remove the last point the sweep sort of succeeds and shows a rather weird shape, so I guess it is something with the B-spline.
It may well be the case that the bspline is somehow "incorrect".
I created the bspline with this code:

Code: Select all

import numpy as np
import Draft
points=30
zpoints=np.linspace(0,2.6,points)
sketch=FreeCAD.getDocument('MakeCable').getObjectsByLabel('Path')
b=sketch[0].Shape.makeOffset2D(4).discretize(points)
for i,j in enumerate(b):
	j.z=zpoints[i]
spline1 = Draft.make_bspline(b,closed=False)
The path is a 2d sketch, and I offset it and stretch it along the z-axis to make it 3D.
Is there something wrong with this code?
Thanks.
browntoastjam
Posts: 37
Joined: Fri Aug 20, 2021 9:51 pm

Re: Unable to Sweep in Path WB

Post by browntoastjam »

Here is another similar example that fails.
The text document within the freecad doc has the exact commands used to create the bspline.
Attachments
testbspline.FCStd
(12.02 KiB) Downloaded 10 times
chrisb
Veteran
Posts: 54177
Joined: Tue Mar 17, 2015 9:14 am

Re: Unable to Sweep in Path WB

Post by chrisb »

browntoastjam wrote: Sun Nov 27, 2022 10:55 pm I created the bspline with this code:
If nobody weighs in, you may repost this in the Python subforum.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply