Drawing Template Sets And Their Implementation In FreeCAD

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
User avatar
NormandC
Posts: 12264
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby NormandC » Sun Feb 09, 2014 4:58 pm

What I don't like about SVG is that it doesn't seem to include a definition for real circles and arcs. They are converted to some Bézier curve or something.
triplus
Posts: 4993
Joined: Mon Dec 12, 2011 4:45 pm

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby triplus » Sun Feb 09, 2014 5:32 pm

There will be support for exporting to SVG. The whole idea of this was to have a general representation so we can export between format. Whether it is just parts/views in a drawing or the whole drawing itself.


Great.

I know what you mean where SVG has the feature set and nice templates can be made through Inkscape. Personally, I wouldn't want to edit a template unless I really needed.


In my opinion majority of CAD users sooner or later use custom drawing templates. This just makes sense in the end and it might make sense to include the most standard page sizes in simplest form as possible by default in FreeCAD. Maybe completly empty or with just added border and simple head? This is something your approach could do? A script to create simple standard page size template on the fly but everything else should really be left to users and custom templates?

What I don't like about SVG is that it doesn't seem to include a definition for real circles and arcs. They are converted to some Bézier curve or something.


I am not sure if this is correct or are you talking about current SVG support/implementation in FreeCAD?
User avatar
NormandC
Posts: 12264
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby NormandC » Sun Feb 09, 2014 5:42 pm

triplus wrote:I am not sure if this is correct or are you talking about current SVG support/implementation in FreeCAD?

I am talking about both.

Draw a circle in Inkscape, export it to AutoCAD R14 DXF, and open it in LibreCAD. The circle is not a true circle, but a collection of Splines.

Same thing when you export a FreeCAD Drawing page to SVG, any arc or circle is converted to Bézier curves. Which makes me believe real arcs are not supported by the SVG specification. If that is the case, it simply won't do as a CAD format.
triplus
Posts: 4993
Joined: Mon Dec 12, 2011 4:45 pm

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby triplus » Sun Feb 09, 2014 6:16 pm

normandc wrote:
triplus wrote:I am not sure if this is correct or are you talking about current SVG support/implementation in FreeCAD?

I am talking about both.

Draw a circle in Inkscape, export it to AutoCAD R14 DXF, and open it in LibreCAD. The circle is not a true circle, but a collection of Splines.

Same thing when you export a FreeCAD Drawing page to SVG, any arc or circle is converted to Bézier curves. Which makes me believe real arcs are not supported by the SVG specification. If that is the case, it simply won't do as a CAD format.


Probably this is exporter to SVG and converter to DXF limitation and adding SVG circle/arcs support is harder to implement compared to current approach and it might be exported SVG with real circles/arcs would convert to real DXF arcs/circles but one of the developers will probably have more insight!
User avatar
yorik
Site Admin
Posts: 8661
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby yorik » Sun Feb 09, 2014 7:36 pm

If you draw a circle in inkscape, and examine its code (the <> button), you see it's actually a path (which can be a spline or polyline). But, there are a couple of "sodipodi" attributes (the ancestor of inkscape) that allow inkscape to know that it is in reality a circle. This is common to inkscape, they draw everything as paths, but they use these sodipodi attribute to "know" what type of element it is. Other applications, unaware of the sodipodi attribute, still render the SVG correctly, no matter what new features inkscape developers implement. And this allows them to implement new stuff without breaking the SVG standard.

Since we use inkscape files quite a lot, it might actually be interesting to support some of those attributes. Anyway, converting from/to SVG and DXF is something doable with reasonable guarantee, at least for basic object types. I use freecad for that quite often, actually 8-)
triplus
Posts: 4993
Joined: Mon Dec 12, 2011 4:45 pm

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby triplus » Sun Feb 09, 2014 8:31 pm

Yes i thought it should be something like that. SVG has to tell somehow to the DXF converter what (element) it is converting and to what exactly.

Because FreeCAD as said above will be able to export to both SVG/DXF in the future too quality of exported drawings will probably always be limited to exporter limitations and more amount of work is it put in this area better it will work. If FreeCAD would do this really good in the future i guess that could be the basis for other (CAD) FOSS projects adding SVG support as viable option for CAD purposes too but that is somewhere in the future and we will see. Additional information for DXF converting purposes could be added to SVG and that would not affect SVG presentation itself on wide range of other SVG software but as SVG might not be the basis for FreeCAD DW anymore there might be no real need for making good SVG/DXF converter instead making just good SVG/DXF exporter? That is a bit of a shame but still having the possibility to create quality SVG/DXF drawings (like now) with FreeCAD is something to look forward too! And to add dimensions... 8-)