View Issue Details

IDProjectCategoryView StatusLast Update
0000492FreeCADFeaturepublic2017-04-28 12:33
Reporterwmayer Assigned Toyorik  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Target Version0.13Fixed in Version0.13 
Summary0000492: Sketcher: Create from existing 2d elements
Descriptionhttps://sourceforge.net/apps/phpbb/free-cad/viewtopic.php?f=8&t=1941
https://forum.freecadweb.org/viewtopic.php?f=8&t=1941
TagsNo tags attached.
FreeCAD Information

Activities

danielfalck

2011-11-23 19:47

reporter   ~0001342

Werner,
I could work on this one.

Dan Falck

yorik

2011-11-24 00:56

administrator   ~0001344

Me too... I'll assign this to myself, but Dan feel free to work on it... (I attach your macro here...)

2011-11-24 00:57

 

DXF2Sketch.py (Attachment missing)

wmayer

2011-11-26 10:18

administrator   ~0001353

IMO we should avoid to make the Sketcher dependent on the Draft module. My idea actually is to load the DXF file with the Draft module as usual and then from the created document transfer all the 2d geometry types to a sketcher object. This approach is also more flexible because you can convert a draft you did to a sketcher.

yorik

2011-11-26 12:50

administrator   ~0001354

Yes I totally agree with that, it is indeed what I had in mind too, a simple tool that converts between sketch and draft.

And if there is also a DXF importer that makes a sketch directly, it should belong to the sketcher module and not depend on the draft module...

Jriegel

2011-11-29 17:52

administrator   ~0001376

I think in future a dxf to sketch converter can also create some constraints
(as an option) Thats not possible in the Draft module...

yorik

2011-12-07 13:54

administrator   ~0001413

The Draft module now has a Draft <-> Sketch tool. I'll leave this open in case Dan or someone else (me maybe) wants to work on a Sketcher DXF importer

wmayer

2011-12-07 16:16

administrator   ~0001415

It would be nice to open a transaction so that it is undo/redo-able.

yorik

2011-12-07 17:24

administrator   ~0001416

Oops that's true... Thanks for looking! I just fixed that.

wmayer

2011-12-08 07:58

administrator   ~0001421

Last edited: 2011-12-08 08:01

IMHO I see no need to have an extra DXF importer for the Sketcher module. The process as it is now to load a DXF file in the Draft module and use this awesome function to convert is absolutely sufficient. Why re-inventing the wheel (with a second DXF importer)?

Maybe the only thing I would do then is to implement a function in Draft that loads the DXF and convert it immediately to a Sketcher. In the Complete wb this command then can be added to the Sketcher menu, too.

yorik

2011-12-08 09:39

administrator   ~0001423

Good idea too! About direct DXF import in the sketcher I kind of agree, but why not, if someone wishes to do it... Maybe I'll close this report when this tool is good, though, and that would be for another one, if any.

Note to self - Things I'll still implement here:

- merge all in one result if several objects of same type are selected
- do not produce anything if it's a spline
- add basic constraints when applicable (wires, rectangles, circles)
- add "Auto-sketch" option in DXF import

yorik

2011-12-08 13:32

administrator   ~0001424

The 4 features from the post above are now implemented in r5238. I just couldn't implement auto-radius yet because there is no python binding for it yet in Sketcher ConstraintsPy. When I have a minute more I'll look into fixing it.

To import DXF files directly to sketches, now, it's just a matter of selecting "Create Sketches" in Preferences->Draft->DXF->Import type. If any of the options "make blocks" or "join geometry" is marked, ALL the imported file will go in ONE sketch (might become pretty heavy)

There are now autoconstraints on wires and rectangles too. I separated the sketch making function from the GUI tool, so that it also by used from python with Draft.makeSketch(list_of_objects,autoconstraints=False)

Now there are certainly some remaining bugs around...

yorik

2012-01-10 13:24

administrator   ~0001552

Okay I think we can consider this done now... Any problem just reopen!

Issue History

Date Modified Username Field Change
2011-11-23 13:33 wmayer New Issue
2011-11-23 19:47 danielfalck Note Added: 0001342
2011-11-24 00:56 yorik Note Added: 0001344
2011-11-24 00:57 yorik File Added: DXF2Sketch.py
2011-11-24 00:57 yorik Status new => assigned
2011-11-24 00:57 yorik Assigned To => yorik
2011-11-26 10:18 wmayer Note Added: 0001353
2011-11-26 12:50 yorik Note Added: 0001354
2011-11-29 17:52 Jriegel Note Added: 0001376
2011-12-07 13:54 yorik Note Added: 0001413
2011-12-07 16:16 wmayer Note Added: 0001415
2011-12-07 17:24 yorik Note Added: 0001416
2011-12-08 07:58 wmayer Note Added: 0001421
2011-12-08 08:01 wmayer Note Edited: 0001421
2011-12-08 09:39 yorik Note Added: 0001423
2011-12-08 13:32 yorik Note Added: 0001424
2012-01-10 13:24 yorik Note Added: 0001552
2012-01-10 13:24 yorik Status assigned => closed
2012-01-10 13:24 yorik Resolution open => fixed
2012-01-10 13:24 yorik Fixed in Version => 0.13
2017-04-28 12:33 Kunda1 Description Updated