Flaky Draft > Upgrade

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
earthcare
Posts: 26
Joined: Tue May 31, 2016 7:46 am
Location: Australia

Flaky Draft > Upgrade

Post 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
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Flaky Draft > Upgrade

Post 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.
earthcare
Posts: 26
Joined: Tue May 31, 2016 7:46 am
Location: Australia

Re: Flaky Draft > Upgrade

Post 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.
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Flaky Draft > Upgrade

Post 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
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
Post Reply