Inkscape and Freecad: Bezier’s curves and path objects

It happened to me a few times to have a drawing in svg Inkscape format, to be imported into FreeCAD as a starting 2D shape to design 3D objects.bezier_curve

Inside Inkscape, very often the shapes  are path objects made of Bezier’s curves. Once imported inside FreeCAD, a Bezier’s curve path is a “path” object which bezier_curve_fccorresponds to a unique “edge” object when downgraded.  Zooming in enough, it is clearly visible how the curve inside FreeCAD is a polygonal chain, whit no control at all by the user about how the segments are created and no access to them (being a unique “edge” object). Inkscape offers theflat_bez_menu possibility to flatten paths, approximating each path with a polyline whose segments meet the user specified criteria for flatness.

Once flattened, the path will be imported as a polyline inside FreeCAD and is expanded into all the segments when downgraded (in the “Draft” workbench) from a “path” object into the collection of “edge” objects. These objects can then be handled by the user as FreeCAD objects, converted from “draft” into “sketchbezier_flat_fc” objects, moved and adjusted in case of need.

Attention must be payed to multiple nodes: sometimes, whether a curve is flattened or not, an Inskape path has two ore more nodes which are overlapping. When this is the case, it happens often that the FreeCAD import keeps only one of the nodes, not necessarily the one in common with the adjacent segment, generating a discontinuity in the imported segments curve. mult_pointsThe gap is hardly visible to the naked eye, but “inexplicably” generates a surface, instead of a solid, when extruded. It is important, therefore, to merge  the overlapping groupes of nodes into one single node each, before importing  the svg file into FreeCAD (and probably for any other import and for other Inkscape usage also).

Remember to import the svg file “as SVG geometry”, not as “Drawing” , if you want to handle it as a FreeCAD object.