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!
User avatar
easyw-fc
Posts: 2614
Joined: Thu Jul 09, 2015 9:34 am

BSplines to Shape2DView and Sketcher

Postby easyw-fc » Sat Oct 28, 2017 1:58 pm

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 1893 times
triplus
Posts: 8605
Joined: Mon Dec 12, 2011 4:45 pm

Re: BSplines to Shape2DView and Sketcher

Postby triplus » Sat Oct 28, 2017 6:27 pm

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

Re: BSplines to Shape2DView and Sketcher

Postby chrisb » 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.
User avatar
easyw-fc
Posts: 2614
Joined: Thu Jul 09, 2015 9:34 am

Re: BSplines to Shape2DView and Sketcher

Postby easyw-fc » Sun Oct 29, 2017 1:16 pm

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
Posts: 2614
Joined: Thu Jul 09, 2015 9:34 am

Re: BSplines to Shape2DView and Sketcher

Postby easyw-fc » Tue Oct 31, 2017 10:30 pm

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 1587 times
User avatar
Chris_G
Posts: 1086
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: BSplines to Shape2DView and Sketcher

Postby Chris_G » Wed Nov 01, 2017 9:36 am

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 1542 times
chrisb
Posts: 17600
Joined: Tue Mar 17, 2015 9:14 am

Re: BSplines to Shape2DView and Sketcher

Postby chrisb » Wed Nov 01, 2017 9:59 am

Awesome!
triplus
Posts: 8605
Joined: Mon Dec 12, 2011 4:45 pm

Re: BSplines to Shape2DView and Sketcher

Postby triplus » Wed Nov 01, 2017 12:37 pm

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