BSplines to Shape2DView and Sketcher

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

BSplines to Shape2DView and Sketcher

Post by easyw-fc »

Hi,
to improve integration between FreeCAD and KiCad I developed a way to approximate BSplines in sketcher to Arcs (thanks to @wmayer for some improvements in FC) ... from that side I evolved my old macro Macro_DXF_to_Face_and_Sketch to add the ability to convert a shape or a dxf or a svg containing BSplines to a Sketch, where the sketch is obtained as an approximation of the BSplines to Arcs.
The new macro is included in the StepUp WB

Image

This is also useful to convert i.e. a step model that has some spline to a 2D edge and then a Sketch for improve internal elaboration
step-bspline-to-sketch.gif
step-bspline-to-sketch.gif (710.17 KiB) Viewed 4490 times
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: BSplines to Shape2DView and Sketcher

Post by triplus »

Looking good.
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: BSplines to Shape2DView and Sketcher

Post by chrisb »

It would be great, if you could integrate your code in the Draft Workbench, where we have already a function Draft<->Sketch, which cannot handle BSplines.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: BSplines to Shape2DView and Sketcher

Post by easyw-fc »

chrisb wrote: Sat Oct 28, 2017 9:50 pm It would be great, if you could integrate your code in the Draft Workbench, where we have already a function Draft<->Sketch, which cannot handle BSplines.
The Bspline approximation to Arcs is very useful for KiCad, because KiCad doesn't have bspline support.

For FreeCAD the best would be to convert the Edge to a real BSpline Sketcher
I asked Chris a support at this topic
Cuerves WB topic

Maurice
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: BSplines to Shape2DView and Sketcher

Post by easyw-fc »

Thanks to @Chris_G :D
Chris_G wrote: Curve WB
finally I can convert a SVG or a DXF file with BSplines, Ellipses, Arcs, Lines to a Sketch in FC.
The Sketch will keep BSplines, Ellipses, Arcs and Lines as they were in the Edges and the Sketch can then be pushed to KiCad.
The Pushing will approximate the pcb Edge with Arcs and Lines in KiCad, because there only Arcs and Lines are allowed entities.
Requirements: FC0.17

bspline-to-sketch.gif
bspline-to-sketch.gif (935.46 KiB) Viewed 4184 times
User avatar
Chris_G
Veteran
Posts: 2579
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: BSplines to Shape2DView and Sketcher

Post by Chris_G »

chrisb wrote: Sat Oct 28, 2017 9:50 pm It would be great, if you could integrate your code in the Draft Workbench, where we have already a function Draft<->Sketch, which cannot handle BSplines.
The Draft<->Sketch conversion tool now supports BSplines curves.
Bezier Curves, which are not directly supported by sketcher, are converted to BSpline curves in the process.
Please note that the internal geometries of the BSplines (the control points) are not exposed by default, in order to keep the sketch cleaner and lighter.
For example, an imported SVG path with multiple curve segments, could lead to a rather heavy and messy sketch.
These internal geometries can be manually exposed for each BSpline curve with Sketch -> Sketcher tools -> show/hide internal geometry :

sketcher.jpeg
sketcher.jpeg (102 KiB) Viewed 4139 times
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: BSplines to Shape2DView and Sketcher

Post by chrisb »

Awesome!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: BSplines to Shape2DView and Sketcher

Post by triplus »

Chris_G wrote: Wed Nov 01, 2017 9:36 am The Draft<->Sketch conversion tool now supports BSplines curves.
Thanks.
Post Reply