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.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Drawing Template Sets And Their Implementation In FreeCA

Post by ulrich1a »

shoogen wrote:In translated mode it shifts everything around by the margin.
At least with the very current FreeCAD, you can draw a rectangle in the xy-plane in the Draft-Workbench. Then save it as flattened SVG and it will be open fine in the Drawing-SVG-Viewer. Making the frame right, by observing the 1% added margin, a template is in reach. You will have small files, as there is not added so much additional content as in Inkscape. Thats all, I wanted to say.
Ulrich
j-dowsett
Posts: 210
Joined: Wed Sep 07, 2011 9:37 am

Re: Drawing Template Sets And Their Implementation In FreeCA

Post by j-dowsett »

mrlukeparry wrote:If we're all happy to go with this approach, it'd be good to organise what this script needs so I know what your requirements are and I can go about implementing it and just be a bit more systematic about this.
I think something along these lines is indeed the way to go, particularly if it works well in your new drawing workbench. If I'm getting anything like the right gist, then the new workbench has a distinction between the template and whatever file format the drawing ultimately might be exported as? If that's the case then I can see even more how generating a template from a script offers a better way of working.
ulrich1a wrote:I start have the feeling, that there seems to be a misunderstanding. This script has just the potential to generate different templates for the current drawing workbench. The current drawing workbench has a parser to use svg-files, which is organized as an xml-format. So your new workbench may just use the allready existing code for parsing these files.
What can be new, is the possibilty to generate different template one the fly, with the users choice of paper-format, language, orientation and title-block style. I did only paper-format and orientation. Language, svg-symbols and more options are still todo.

Ulrich
I can see what you are thinking, but once a template can be generated simply from a set of parameters or options, then even if currently it generates that as an SVG file, I think the point is that the logic and principles you've used should be applicable to creating that template in a more abstract sense that isn't tied to an image format, but more provides the new drawing workbench with information (where the lines are that make up the border, eg) in whatever form works best. Having said that, I never really got around to thinking how even the current SVG templates could be generated, so you're way ahead of me... I'm afraid I've also still to look at your script to see the approach you've taken.

Of course I may still have misunderstood Luke's exact ideas...?!

mrlukeparry wrote:I think we need to devise a list of public properties e.g page width, page height, type that are accessible to the script so that it can be used inside calculations or as part of logic.

Similarly we need to know what the inputs of these parametric templates are given to the script. Then if needed I can build up a parser but it may even be the case that its not needed - e.g. reading directly from the script.

Once we've all agreed to something then we can start pushing together to produce something :)
I'm afraid I've not any great ideas on what parameters / properties would specify a template. I could imagine that whatever we did someone would still come up with something they wanted for their template that didn't fit with the script-generated approach?


I'm making some progress with what I'm working on (SVG template selection dialog), though I don't think it'll be directly applicable any more with these changes. I imagine templates generated from sets of parameters will still need to be 'saved' (ie save the parameter combination) and available for selection, so if appropriate I can adapt what I've got when it's a little clear how this might work.


ps - Luke, just read your latest blog post, that's looking really good, I'd not realised you'd managed quite so much progress recently.
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Drawing Template Sets And Their Implementation In FreeCA

Post by shoogen »

ulrich1a wrote:You will have small files, as there is not added so much additional content as in Inkscape.
Inkscapes offers to save 'plain svg' files which a less cluttered.
mrlukeparry
Posts: 655
Joined: Fri Jul 22, 2011 8:37 pm
Contact:

Re: Drawing Template Sets And Their Implementation In FreeCA

Post by mrlukeparry »

j-dowsett wrote: can see what you are thinking, but once a template can be generated simply from a set of parameters or options, then even if currently it generates that as an SVG file, I think the point is that the logic and principles you've used should be applicable to creating that template in a more abstract sense that isn't tied to an image format, but more provides the new drawing workbench with information (where the lines are that make up the border, eg) in whatever form works best. Having said that, I never really got around to thinking how even the current SVG templates could be generated, so you're way ahead of me... I'm afraid I've also still to look at your script to see the approach you've taken.

Of course I may still have misunderstood Luke's exact ideas...?!
Yes, template geometry is abstract i.e. lines, circles, text, etc. In the end we should be able to get people to easily write export functions in python or c++ in the long term.

I need to check if we can use PySide on a custom QGraphicsView Canvas as that saves us having to reimplement the wheel so to speak.
j-dowsett wrote:I'm making some progress with what I'm working on (SVG template selection dialog), though I don't think it'll be directly applicable any more with these changes. I imagine templates generated from sets of parameters will still need to be 'saved' (ie save the parameter combination) and available for selection, so if appropriate I can adapt what I've got when it's a little clear how this might work.
We still need one for 'standard' default paper sizes, so we still need a nice template selector ;) I wouldn't want anyone having to remember paper sizes. Try your best to see what you can come with as it should still be fairly re-usable to some extent :)
j-dowsett wrote:ps - Luke, just read your latest blog post, that's looking really good, I'd not realised you'd managed quite so much progress recently.
Yeah, I forgot how much had been done. I am actually pretty pleased with the result already - I've recently been forced to use Pro/E Creo and it's 2D drawing workbench is hardly intuitive.
User avatar
quick61
Veteran
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Drawing Template Sets And Their Implementation In FreeCA

Post by quick61 »

We still need one for 'standard' default paper sizes, so we still need a nice template selector ;) I wouldn't want anyone having to remember paper sizes. Try your best to see what you can come with as it should still be fairly re-usable to some extent :)
This is good to hear. IMO there are good reasons to continue support for standard templates as i don't think any auto-generator could replace them entirely. So please j-dowsett, do continue your work. It is needed. :)

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Drawing Template Sets And Their Implementation In FreeCA

Post by jmaustpc »

The problem with the current system is maths .... every time you add any feature to a template you multiply the total number of Templates...not add...hence we end up with an exponential increase in template files, so that is not scalable.

If you want to use the old system, I think, it goes back to what I said earlier ...we should just have standard svg files of any sort...then they can be drawings or brochures or anything...this then becomes an SVG workbench. We should in that scenario have another "svg" workbench (if needed), but for most scenarios we could just have a "blank" template for SVG output that the user could then manipulate in an SVG application.

For a proper Drawing (technical drawing production) workbench that can export to various formats and is only designed to make technical Drawings ...we, in the long term, need something Like Luke is creating...and the Templates must have elements itemised one way or another.

We could then possibly have a list the "elements" of a template and then have an input mechanism.

elements would include things like
1) boarder
2) paper size
3) paper orientation
4) title block
5) a "custom" element (that could contain anything unusual that is not covered by other element types)
6) etc.

The input mechanism
We could possibly us FreeCAD functionality in some way e.g. make borders with Sketcher, Draft etc.. Of course Luke has some ideas here ...and knows more than I. :-)

One idea I was thinking about was the input mechanism could still be SVG as it currently is...but split templates into multiple templates just each contain just a specific element. E.g. a SVG template file might be for a boarder, so that's all it would have (just the boarder). Another could be the title block. etc.

Then you could create a template from a group of element templates ...and optionally save the "group of element templates" as something roughly like a HTML "bookmark" in Firefox etc., FreeCAD would combine all those elements into one template.

This post is too long so I have split of paper size into another
Jim
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Drawing Template Sets And Their Implementation In FreeCA

Post by jmaustpc »

This post is getting to long so I have split up the Paper size part.

Regarding paper size, since ISO is scalable, for most of the world, in many circumstances paper size can be irrelevant. The key point for ISO users (the whole planet, to at least some degree) is that when scaling do you, or do you not, want just the drawing scaled or the whole thing scaled (including all elements e.g title block). Page orientation and series (A or B etc.)

Often you want the entire drawing and all its elements scaled, normally I do, because you only print A4 because you don't have a larger printer, mostly, hence you want the title block scaled as well, so that you don't waste space on the smaller paper, you compromise by making all the text etc. smaller but if the text is correct on A3 it is still legible at A4, just smaller, all the entire world except those using ANSI have to do is just click "scale to fit" on the printer driver and your A3 comes out perfectly on an A4 printer, I have made many A3 drawings and then just printed them in A4, when my A3 printer died. :)

Luke, I was thinking what could be a really useful feature though is to print a drawing over two pages, from within FreeCAD, and intelligently define the joint margin.

For insertion into a "book" of A4 this works well sometimes. Also where a professional appearance is irrelevant, you can just put the two A4 sheets face to face then staple/sticky tape them together then unfold them. Of course with ISO sizes all being proportionate and scalable, this method applies to all sizes, so not matter how big your printer is...you could always print to the next size up.

Of course this scales beyond the next size, you could also possibly want print to four pages etc.. e.g. A4 to A2. etc.

You do have to deal with the issue of the joint margin, unless you have a border-less printer and some stick tape :-)

I have in the past had a printer driver with this functionality and it is common the other way around (putting tow pages on one etc.).

Jim
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Drawing Template Sets And Their Implementation In FreeCA

Post by shoogen »

The scaling down an A3 sheet to fit on A4 paper is something would consider a destructive operation since it overwrites the scaling of the drawing.
I'm not yet happy with the mechanism to ensure that the line width and text height of the template match those of the projected views. (fullwidth (1x), halfwidth (0.5x), symbolwidth (1/sqrt(2)x) and textheigth (10x) from ISO128)
An advanced template mechanism should as well automatically add the appropriate symbol for first angle or third angle projection.
So that we don't need to supply the same template twice.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Drawing Template Sets And Their Implementation In FreeCA

Post by jmaustpc »

shoogen wrote:The scaling down an A3 sheet to fit on A4 paper is something would consider a destructive operation since it overwrites the scaling of the drawing.
Not necessarily, only if you write scale a in text somewhere "scale = 1:20" or something like that, which if someone gets it right works, but is dangerous, because you will find in practice a lot of peoples printers scale the document a small amount for various reasons.

Scale is safer to describe by a line with a dimension, or to dimension something in the drawing, then it doesn't matter how you scale at print time, the drawing will always be correct.

Now days surely a lot of drawing would remain electronic, perhaps inserted into a pdf, or in some other common format so they can be easily read without a specialised CAD application. If you are reading off a monitor then scale could be anything, unless defined by a dimension or similar. The border could show a scale, I guess.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Drawing Template Sets And Their Implementation In FreeCA

Post by ulrich1a »

My template generator script, I posted here viewtopic.php?f=8&t=5232&start=70#p44393
seems to be overlooked. I just wonder, as there was some interest in it. ;)
Ulrich
Post Reply