Page 1 of 1

Flaky Draft > Upgrade

Posted: Wed Jun 22, 2016 6:18 am
by earthcare
I'm having issues (again) with upgrading an imported SVG file so that I can extrude it.

I create it in LibreCAD, and do one of the following:
1. import the DXF file into FreeCAD, run draft > upgrade twice to go from lines to wire to face, then run part > extrude. I get a hollow object, indicative of not having a face - although the model tab shows it as a face.

2. export it as an SVG, clean it up in Inkscape, and import the SVG file into FreeCAD as geometry, run draft > upgrade twice to go from lines to wire to face, then run part > extrude. I get a hollow object again.

2. export it as an SVG and import the SVG file into FreeCAD as geometry, clean it up, run draft > upgrade twice to go from lines to wire to face; although the model tab shows it as a face, it looks like like a set of points without lines. Selecting the face and extruding it results in a hollow object, but clearly the scale have been lost.

What am I doing wrong? I was able to do a simpler object easily.

This is the object: Image

Re: Flaky Draft > Upgrade

Posted: Wed Jun 22, 2016 7:30 am
by ickby
Hello,

I don't know if this is the reason for failure, but the geometry of the picture cannot be extruded into a valid solid as it would be non-manifold. The point where the two tips meet is a unhandable condition for solid geometry. If there is a point in thi sposition it will result in an edge shared by more than 2 faces. If this are just two lines crossing it will be a selfintersecting wire which is invalid by definition. Quite likely that the extrude is therefore able to make the shell but not a solid out of it.

Re: Flaky Draft > Upgrade

Posted: Wed Jun 22, 2016 10:27 pm
by earthcare
Ickby

Thanks for the suggestion: that was a snap point for the 3D printed model, but your solution was obvious - once you thought of it for me. Thanks.

Re: Flaky Draft > Upgrade

Posted: Thu Jun 23, 2016 9:05 am
by mario52
hi
my model just to see
svg create parh
import the SVG file into FreeCAD as geometry
create rectangle > face = True
and uses the very good bernd macro with little modification

make faces from edges

Code: Select all

# -*- coding: utf-8 -*-
# http://forum.freecadweb.org/viewtopic.php?f=22&t=16079
# creer une face autour des objets et la selectionner (ex rectangle face=true)
edges = []
for o in App.ActiveDocument.Objects:
#    print o.TypeId
    if str(o) !=  "<group object>":
        print o.Shape.ShapeType
        if (o.Shape.ShapeType == 'Edge') or (o.Shape.ShapeType == 'Wire'):
            edges.append(o.Shape)

fusion_wire = edges[0]
for no, e in enumerate(edges):
    no += 1
    if no > 1:
        fusion_wire = fusion_wire.fuse(e)

ex = fusion_wire.extrude(FreeCAD.Vector(0,0,5))
FreeCAD.ActiveDocument.recompute()

sel = FreeCADGui.Selection.getSelection()
#print str(sel[0].Shape.ShapeType)
slab = App.ActiveDocument.getObject(sel[0].Name).Shape.cut(ex)

for f in slab.Faces:
    Part.show(f)
ratchettest2.FCStd
(299.08 KiB) Downloaded 32 times
mario