Draft module fully parametric

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
yorik
Site Admin
Posts: 12034
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Draft module fully parametric

Postby yorik » Mon Aug 02, 2010 4:30 pm

I think I finished the conversion of the Draft module. Everything is now parametric (unless I forgot one thing or 2). That means:
  • If you don't know/care what parametric is, everything continues working just the same way, no need to worry ;)
  • All draft objects now can appear as face or wireframe, no more need to upgrade them. Just check the "fill" checkbox when creating them, or, at anytime, change their display mode.The default fill behaviour can be set in preferences.
  • Lines and Wires, instead of being dumb Part shapes, now have a "Points" attribute that stores their vertices (which will be very useful for editmode), and can also be constructed from 2 other shapes (union). In that case, they get updated when the base shapes are updated too.
  • Circles and Rectangles are also parametric, they are constructed form "Length", "Width" or "Radius" parameters, and have a placement.
  • Dimensions can now be associated to an object. If, when drawing the dimension, you select an edge by pressing ALT instead of 2 points, the dimension will be associative and remember which vertices of the underlying object it must measure. If the object changes, the dimension too (But beware, if the indices of vertices changes, strange results can occur)
  • Upgrading tries to use the new Draft Wires whenever possible: if you upgrade 2 coplanar shapes, for example, or if you upgrade one single new Draft parametric object. If you upgrade 2 non-coplanar shapes, a standard Part Fuse is created
  • Downgrading 2 objects together creates a Part Cut
  • Extruding a shape with the trimex tool now produces a Part Extrusion
That's it I think, not much visible change, but that will allow me to build a cool editmode!
User avatar
jriegel
Site Admin
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Draft module fully parametric

Postby jriegel » Mon Aug 02, 2010 5:29 pm

Very impressive!

Good job!
Stop whining - start coding!
guest

Re: Draft module fully parametric

Postby guest » Mon Aug 02, 2010 7:28 pm

Dito!
;-)
User avatar
yorik
Site Admin
Posts: 12034
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Draft Put On Sheet command

Postby yorik » Mon Aug 16, 2010 10:04 pm

I'm making some progress with the Draft->Drawing process. There is a new tool on the Draft workbench (when it's finished I'll add it to the complete workbench too) that adds selected geometry to a sheet. You can choose to create a new sheet or add to an existing sheet. In that case, objects with the same name will be updated, so if you have a sheet with only half of your objects on it, you can safely select everything and run the command again.

You can choose the scale, the X/Y offset, and a size modifier for linewidths and texts. The pages remember their scale and X/Y offsets, so when you select an existing page, you don't need to set these values again. Here is the kind of result that you can obtain:

Image

Image
the fcstd and svg files is available here, if you want to check:
http://yorik.uncreated.net/scripts/fcsheet.fcstd
http://yorik.uncreated.net/scripts/fcsheet.svg

The above image is a direct export from the Draft's PutOnSheet command, there was no rework in Inkscape (I opened it in inkscape because FreeCAD's SVG viewer doesn't display pattern fills, I suppose a missing feature in Qt SVG stuff). Closed Draft objects (circles, rectangles and wires) have a "Fill Style" property, that can be used to specify a hatch pattern. At the moment I made 5 basic ones, but in the future the idea is to allow the user to add a custom hatch patterns file.

I still have a couple of small issues (the position of the texts, for example) but for the rest I think it already can output professional-looking plans almost 100% correctly....
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Draft module fully parametric

Postby NormandC » Tue Aug 17, 2010 6:49 am

I had a look at the svg file. It looks great Yorik! 8-)

And I like the "Built with FreeCAD" text, link & logo on the draft template. :)
User avatar
yorik
Site Admin
Posts: 12034
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Re: Draft module fully parametric

Postby yorik » Tue Aug 17, 2010 1:08 pm

Thanks! One needs to do a little propaganda for freecad! I surely intend to release my own drawing with a "made with FreeCAD" tag ;)

The other thing I'm still not happy about are the hatches... Doing perfect-looking line hatches in svg is not easy... At render time there is a kind of unit rounding happening, so when you do diagonal hatching, the hatch tiles dont fit perfectly... In the above svg file, if you zoom in a lot you see it clearly. I must see if it appears at print...

The whole idea I have is to be able to produce this kind of documents (these are older works of me, mostly done with autocad):

Image

Image

Image

Image

Image

I think we are pretty close... The only missing things I want to implement later are "leader" lines (a line with an arrow at the end, which is used to "bind" an annotation with a point on the drawing) and svg clipping ("masking" parts of the svg contents with a shape), which should be fairly easy to do, looking at the svg docs (only need to encapsulate entities inside a clip node). Actually it might even be interesting to have that clipping node defined inside the template itself...

And maybe if I think of some way to do it, "automatic" symbols, that can extend, change forms, carry informations, etc... Like section symbols and stuff like that (But I think that will be more for the arch module)
vu2011
Posts: 55
Joined: Thu Oct 20, 2011 7:24 pm

Re: Draft module fully parametric

Postby vu2011 » Fri Apr 20, 2012 1:06 pm

The 'leader arrow style' of a dimension on a drawing sheet is not "so nice" for me (s. attached picture , e.g., 4 big black points).

Is the 'leader arrow style' of a dimension on a drawing sheet editable ?

If yes, how can I do it parametrically ?

My machine: Ubuntu 10.04 on DELL Latitude D430, FreeCAD 0.13 R0784

Thanks

anh
[img]
http://www.freeimagehosting.net/qhgsc[/img]
User avatar
yorik
Site Admin
Posts: 12034
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Re: Draft module fully parametric

Postby yorik » Fri Apr 20, 2012 2:51 pm

Yes, I know, we need some kind of decent arrow there... But it doesn't exist in the Coin library, so I'll need to code it from scratch...
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Draft module fully parametric

Postby shoogen » Fri Apr 20, 2012 4:13 pm

A nice default for arrows is 15° at the tip and a length of 10 times the (full) linewidth.
Points should have a diameter of 5 times the linewidth. This would be compatible to DIN 406-11
User avatar
yorik
Site Admin
Posts: 12034
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Re: Draft module fully parametric

Postby yorik » Fri Apr 20, 2012 4:17 pm

Thanks! good to know, better to make it standard right from the start indeed. But anyway once they are made with real 3D objects, i think customization will be much easier.