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
quick61
Posts: 3673
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Drawing Template Sets And Their Implementation In FreeCAD

Postby quick61 » Sat Dec 28, 2013 8:50 pm

Yorik suggested a new topic on this subject, grown out of this thread in the “Help on using FreeCAD” sub-forum.

From that thread, several things emerged. There was a feature request filed on Mantis requesting to add North American paper sizes to the pull down menu on the Drawing Workbench. Somewhere in that time frame, I decided to embark on a project of creating complete sets of templates for use with the Drawing Workbench.

Wmayer wrote an initial implementation, (and definite improvement), that now allows for size designations of B, C, D, and E along with the original A. This is now available in the current master development source and the current daily builds. The naming format is as follows (from wmayer's post)

wmayer wrote:The file name must be of the form {Letter}{PageSize}_{Portrait or Landscape}.svg where Letter must be in the range (A,B,C,D,E). So, A_Landscape.svg doesn't work because it lacks of the page size. FYI, it's very important to have this page size because an icon for the drop-down menu gets created on the fly which includes the letter and page size, e.g. E3.

What currently doesn't work either is if the file name starts with "Arch" or "Ansi" or the like.


I have started a GitHub repository for FreeCAD drawing template sets and custom templates. So far I have sets for the following – ANSI, Arch, and ISO – A, along with a couple of contributed templates. Please note that these are a work in progress, so use at your own risk.

Anyone wanting to check them out can either use the “Download ZIP” button (right hand side of page) or, if your a git user -

Code: Select all

git clone https://github.com/quick61/FreeCAD-Drawing-Templates.git


Anyone wanting to share their custom templates, fix mistakes I've made, or any such thing, please fell free to post them and I will include them in the repo. If anyone has complete sets of templates, and/or would like to help in the development of this repo, send me a PM and I'll set you up as a collaborator - (you will need a GitHub account for this). I'm a complete noob at the workings of GitHub so it might not be a “slam dunk” getting someone set up, but we'll get there.

The second and most important reason for opening this thread, is to start a discussion on how best to implement an interface within FreeCAD's Drawing Workbench to give the user easy toolbar access to various template sets and select the sizes within each.

To my thinking, having this, along with the work that  j-dowsett is doing on the OrthoViews, should end up making the Drawing Workbench a very usable and feature rich tool. It's good already - let's make it great. :)

In the meantime, normandc points out in this post -

normandc wrote:One thing that we should keep in mind is that even if templates are not available in the toolbar, you can always load them through the Page parameters.


I'm sure there is more, but I'v typed, (rambled) on long enough and this should get things started.

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
User avatar
jriegel
Site Admin
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby jriegel » Sat Dec 28, 2013 11:11 pm

Great stuff!
The only thing is the license you use. You included a GPL text file.
Unfortunately the GPL we can not accept, since the FreeCAD license policy is LGPL,BSD or similar.
Also a software license is not appropitated for this kind of content. I would suggest the creative commons licenses for that content. E.g. the CC-BY.
Stop whining - start coding!
User avatar
quick61
Posts: 3673
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby quick61 » Sat Dec 28, 2013 11:34 pm

jriegel wrote:Great stuff!
The only thing is the license you use. You included a GPL text file.
Unfortunately the GPL we can not accept, since the FreeCAD license policy is LGPL,BSD or similar.
Also a software license is not appropitated for this kind of content. I would suggest the creative commons licenses for that content. E.g. the CC-BY.


Now that was something I was rather fuzzy on. THANK YOU!! for pointing that out.

Just removed the license. Sorry about that. Could you point to the text of the license I should use, if I should use one at all?

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
User avatar
quick61
Posts: 3673
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby quick61 » Sun Dec 29, 2013 3:11 am

I have a question for you developers or anyone that actually knows. Referring to the Wiki page for Drawing templates, it clearly states the first of 2 rules to follow when making a template is "One pixel = one millimeter" and sure enough, all the templates on the Wiki page are sized that way.

Now, looking at any of the templates that are currently included with FreeCAD, they are scaled in millimeters. From FreeCAD/data/Mod/Drawing/Templates/A4_Landscape.svg -

Code: Select all

width="297mm"
height="210mm"


Which is correct? Or does it matter to FreeCAD, like it just reads the numbers of height and width, and ignores the unit of measure? With the work I'v been putting into these templates, I'm thinking it might be good to know sooner rather than later which one is correct. Especially before I start creating documentation and tutorials.

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
User avatar
shoogen
Posts: 2822
Joined: Thu Dec 01, 2011 5:24 pm

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby shoogen » Sun Dec 29, 2013 11:40 am

AFAIK, FreeCAD does not respect the scale of the template. It simply output its internal representation (mm) as svg user units.
If you want your drawing to useful you have to adjust your template accordingly. In the past inkscape was notorious of ruining templates by controverting the user unit to 90 dpi.
mario52
Posts: 1863
Joined: Wed May 16, 2012 2:13 pm

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby mario52 » Sun Dec 29, 2013 4:19 pm

Hi quick61
all your templates are displayed without lines !
It is this problem which had me do the changes in the file.
an idea ?
Template0.png
Template without lines
Template0.png (119.4 KiB) Viewed 1244 times

mario
Windows 10
Maybe you need a special feature, go into Macros_recipes and Code_snippets. My macros on Gist.github
User avatar
quick61
Posts: 3673
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby quick61 » Sun Dec 29, 2013 7:33 pm

mario52 wrote:Hi quick61
all your templates are displayed without lines !
It is this problem which had me do the changes in the file.
an idea ?
The attachment Template0.png is no longer available

mario


That's strange? I have no such troubles here, but I have an idea. I was saving the files in the default Inkscape format. the file attached was saved in plain .svg. Let me know if it works. I'm thinking that might be the problem. I just looked and the ones I have now and they do not show the lines in my browser, but the one I am attaching does. For that reason alone, I'm going back through and changing them all.

Mark

ANSI_A_Landscape.svg
(74.96 KiB) Downloaded 48 times
This post made with 0.0% Micro$oft products - GOT LINUX?
User avatar
quick61
Posts: 3673
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby quick61 » Mon Dec 30, 2013 4:03 am

I'm going back over the Repo and at least have the ANSI's done. A real PITA, as after saving them in the plain .svg format, I have to go back in with Kate (great text editor) and put all the FreeCAD tags back in. No fun...

On the up side, I'm learning a bit about the way a .svg file is constructed.

Tested them in FreeCAD and viewed them in my browser, and they seem to function and look OK.

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
mario52
Posts: 1863
Joined: Wed May 16, 2012 2:13 pm

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby mario52 » Mon Dec 30, 2013 9:31 am

hi quick61
not lines ! ?
I just tested the Drawing_templates and all are well displayed
mario
Windows 10
Maybe you need a special feature, go into Macros_recipes and Code_snippets. My macros on Gist.github
jmaustpc
Posts: 8094
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Drawing Template Sets And Their Implementation In FreeCA

Postby jmaustpc » Mon Dec 30, 2013 10:00 am

mario52 wrote:hi quick61
not lines ! ?
I just tested the Drawing_templates and all are well displayed
mario


Hi Mario

Could you please post your help about freecad data? I think this might be to do with which version of QT you have. Are you on Windows?

Also try this, select the "page" folder icon in treeview
then click on "web view" icon in the tool bar and see if it displays properly in a web view. (this is using the web browser to display the svg)...does it display properly in the web window?

pageviewweb.jpeg
pageviewweb.jpeg (20.2 KiB) Viewed 1195 times


Also are you using Mark's very latest versions?

Jim