TechDraw without limits = Layout autocad

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
domad
Veteran
Posts: 2053
Joined: Mon Jun 22, 2020 12:16 pm

TechDraw without limits = Layout autocad

Post by domad »

Greetings to the Community!

It is known that I have always been obsessed, (I have been since I met FC), by the difficulties I encountered (not only me) in quoting and enriching the technical drawing using TechDraw.

It was really embarrassing, disheartening and disarming for me to use such powerful software and not being able to produce specialized technical drawings of high detail and precision like the most famous cads.
Today they are not anymore!
I thank “chrisb”, who, with his precise and timely critical stance, pushed me to experiment more and more in order to find a temporary solution to the problem.
Not being a programmer (this is why I simply define myself as a cad "pilot" and as such I tend to make the most of the tools I have or know), I have always wondered if there was a way to be able to use drawing tools of the "Draft" WB (lines, polylines, circumferences, arcs, splines, beziers, etc.), in particular, the snaps, to create, on the object, effectively precise "cosmetic points" that could then be used for dimensioning in TechDraw.
Finally it can be done!
I immediately posted an essential guide, in Italian, which explained the workflow to put it into practice, this flow simply involved the use of the tools and 2D objects available in "Draft":
https://forum.freecadweb.org/viewtopic.php?f=28&t=53329
Today I say even more: it is also possible to use the power and precision of "Sketcher" to generate, from 3D objects, functional "sketch bases" for the production of highly precise and detailed technical drawings, with the possibility of increasing them manually as the report is produced, then paginate them in TechDraw without any problem in defining, precision and formatting the dimensions.
It is the same autocad method with Layouts.
Certainly it is not the final / optimal solution from the point of view of fluidity .... but almost (now I can produce any technical drawing and quote it in TechDraw).
However, it could represent the starting point (or the idea) to write additional code to automate the system and integrate it directly into TechDraw with appropriate button / command functions.
As anticipated, i submit a small guide / suggestion to solve the shortcomings of TechDraw to produce particular dimensions and to enrich the technical drawing of every detail making it more professional and performing in line with the regulations and for every need.
When you realize, due to the complexity of the object to be quoted or due to particular needs, that TechDraw may not be able to satisfy us, it is better to "waste some time" building it ourselves (i call this flexibility / adaptability study) the “drawing base” suitable for TechDraw's dimensioning tools.
To do this you can use (also in harmony) the WB "Draft" and / or "Sketcher".
This method will produce two strands of development (parametric branched structures) which it is advisable to group into:
a) group creation object (3D);
b) group for creating graphic technical drawings (2D);
the objects that we will generate in the structures could be many therefore it is important, to avoid confusion, to organize / order the work flow well, for this i recommend creating special sub-groupings according to your own personal organizational logic.
In detail:
the set a) is the one that will group the classic FreeCad branched structure.
the set b) will group everything that is related to or that will be used for the creation of technical graphics (2D), therefore, I recommend creating ad hoc subgroups according to your personal needs, for example the following subgroups could be created:
- one for the cutting planes to be used to create the sections that will then generate the "base-sketchTD";
- one for the 3D sections of the objects (which may have other subgroups depending on how many sections we intend to represent);
- one using the layers that will group the drawings tables (“base-sketchTD”) which we will then insert as views in TechDraw for dimensioning;
- etc.
The Workbenches that I used to produce the drawings of the attached examples are:
- Draft - Sketcher - WorkFeatureDev – TechDraw

Stages of the procedure:

1) Creation of the 3D object / s according to the canons of traditional modeling;
2) Possible creation of independent or simple copies, eg. to be used for the creation of specific continuous sections positioned on multiple planes or axes, and which then through the use of the "facebinder", "Draft to Sketch", Shape 2D View, etc. functions. it will allow us to produce perfect “Sketches”, then edit them to make them (by creating ad hoc “cosmetic points or lines”) usable in TechDraw; to these sketches I gave the name of "base-sketchTD";
3) insertion / creation of "base-sketchTD" in the layers of belonging (also with "drag and drop");
4) creation of the drawing page with its template;
5) creation of the view with TechDraw: select the layer or the grouping folder (which contains the “base-sketchTD”) from the structure, then click on the “insert view” button; TechDraw will insert the contents of the layer or grouping folder into the view. For a correct creation "base-sketchTD" must be perpendicular to the monitor / display view;
I point out that whatever we add later in the layer or in the grouping-folder, or modifications of the “base-sketchTD”, will be updated in realtime in the TechDraw view. Keep in mind that updates and / or modifications may affect the dimensions already introduced or cosmetic lines created with the specific tool of TechDraw in the view.
6) once the “base-sketchTD” has been defined in the view, we can move on to dimensioning with the appropriate TechDraw tools;
It is possible to insert the "base-sketchTD" also in the projection group views:
- select the projection view -> properties tab -> Data -> “Projection” record section -> Source click on the button with the three dots and directly add the “base-sketchTD” or the layer that contains it.
It should be noted that the "base-sketchTD" must be positioned on the highest face of the model / object, otherwise it will be hidden and will be invisible in TechDraw.
The sections obtained from the views do not seem to have this possibility.
Whenever it is necessary to create precise cosmetic points suitable for dimensioning (e.g. tangency points), they can be generated:
- in "Sketcher" through construction lines and inserting circles with infinitesimal diameter / radius (0.00001) in the ends, these will be seen by TechDraw as points / vertices suitable for dimensioning;
- in Draft with the same method to be inserted in the relevant layer or folder-grouping;
once the "base-sketchTD" has been modified or the Draft object added in the layer or grouping folder, TechDraw will automatically update the view, if this does not happen, update manually with the appropriate command.
To insert section fills or patterns:
pay attention to the lines created on the faces that intersect two or more edges, they are seen by TechDraw as separating elements of the face that affect the creation of the fills or patterns.
This occurs e.g. when creating the outer lines that define the thread of a hole, this line will prevent the fill or pattern from extending further preventing it from arriving on the one that defines the pre-drill hole. In this case it is better to create cosmetic points through construction lines by inserting circles of infinitesimal radius in the vertices that will be seen by TechDraw as cosmetic points and then join them in TechDraw with create cosmetic line by two points.
All lines and / or paths (including cosmetic ones) that are displayed in the views can be edited in the formatting through TechDraw's “Cange Apparence of selected Lines” command.
To create specific continuous sections on different axes or planes, I used the “WorkFeatureDev” workbench which allows you to create “solid” planes, with a thickness of “0”, by selecting three vertices. These planes can be joined through a common or overlapping edge using the Boolean functions of the “Part” workbench and subsequently used for slicing / sectioning the solid model through the “Slice apart” command of the same workbench.
The faces of the cut objects can be suitably exploited for the creation, with the “Facebinder” function, the “base-sketchTD”s to produce specific section views in TechDraw and therefore to be able to dimension and detail them.
I believe I have made public every "trick" (or rather system) experimented to be able to use more specific tools (not provided for TechDraw) and create high quality professional technical drawings without any limits, making the TechDraw workbench more efficient and adaptable to any need , in all likelihood on par (if not more flexible and powerful) than commercial peers.
It should be said, which is not negligible, that with this system it is possible to create entire 2D files and quote them with TechDraw in the same way as "LibreCad" or "Autocad LT" or other two-dimensional cads.
I hope I was clear enough (translation permitting) in explaining the procedure ("trick / system") that I believe to be "easier to do than to say", as it is all about being able to enter 2D drawings into the views of TDs created with "Draft" and / or with "Sketcher" simply by selecting them from the structure and creating a view in TD with the appropriate command "create a view"; but I thought of doing something pleasant and more technical by describing the procedure, certainly, in a "simplified" way to create a minimum of organized workflow.
It is up to each of us, with imagination and inventiveness, to optimize it to the maximum to obtain the best result.
I am attaching the files of some workflow examples of technical drawings (not feasible with TechDraw only) from which the images shown below were taken.
In the hope of having been useful, good work and good experimentation!
Attachments
example_2D_house.FCStd
(882.15 KiB) Downloaded 182 times
EXAMPLE 2D HOUSE-1.png
EXAMPLE 2D HOUSE-1.png (367.94 KiB) Viewed 7392 times
EXAMPLE 2D HOUSE-3.png
EXAMPLE 2D HOUSE-3.png (158.08 KiB) Viewed 7392 times
EXAMPLE 2D HOUSE-2.png
EXAMPLE 2D HOUSE-2.png (142.34 KiB) Viewed 7392 times
domad
Veteran
Posts: 2053
Joined: Mon Jun 22, 2020 12:16 pm

Re: TechDraw without limits = Layout autocad

Post by domad »

......other examples
Attachments
Long shaft example.FCStd
(176.74 KiB) Downloaded 215 times
Long_shaft_example1.png
Long_shaft_example1.png (292.03 KiB) Viewed 7384 times
Long_shaft_example2.png
Long_shaft_example2.png (131.46 KiB) Viewed 7384 times
domad
Veteran
Posts: 2053
Joined: Mon Jun 22, 2020 12:16 pm

Re: TechDraw without limits = Layout autocad

Post by domad »

..........other examples
Attachments
Example_plate_with_threaded_holes.FCStd
(136.72 KiB) Downloaded 154 times
Example_plate_with_threaded_holes1.png
Example_plate_with_threaded_holes1.png (215.95 KiB) Viewed 7383 times
Example_plate_with_threaded_holes2.png
Example_plate_with_threaded_holes2.png (163.9 KiB) Viewed 7383 times
domad
Veteran
Posts: 2053
Joined: Mon Jun 22, 2020 12:16 pm

Re: TechDraw without limits = Layout autocad

Post by domad »

...........other examples
Attachments
example_hub_with_tongue_and_threaded_hole.FCStd
(216.74 KiB) Downloaded 188 times
example_hub_with_tongue_and_threaded_hole1.png
example_hub_with_tongue_and_threaded_hole1.png (153.57 KiB) Viewed 7378 times
example_hub_with_tongue_and_threaded_hole2.png
example_hub_with_tongue_and_threaded_hole2.png (143.03 KiB) Viewed 7378 times
example_hub_with_tongue_and_threaded_hole3.png
example_hub_with_tongue_and_threaded_hole3.png (135.1 KiB) Viewed 7378 times
example_hub_with_tongue_and_threaded_hole4.png
example_hub_with_tongue_and_threaded_hole4.png (110.19 KiB) Viewed 7378 times
domad
Veteran
Posts: 2053
Joined: Mon Jun 22, 2020 12:16 pm

Re: TechDraw without limits = Layout autocad

Post by domad »

..... finally a * .pdf produced with TechDraw
Attachments
PDF.png
PDF.png (47.79 KiB) Viewed 7372 times
example_hub_with_tongue_and_threaded_hole.pdf
(429.48 KiB) Downloaded 140 times
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: TechDraw without limits = Layout autocad

Post by chrisb »

Sorry for being late to this party. I think this post is worth not to be forgotten, so it would be great if you could extend it for a "TechDraw for experienced users" tutorial in the wiki.

This is my favorite:
domad wrote: Mon Jan 18, 2021 3:10 pm - in "Sketcher" through construction lines and inserting circles with infinitesimal diameter / radius (0.00001) in the ends, these will be seen by TechDraw as points / vertices suitable for dimensioning;
We have now a new feature in Sketcher: Points are no longer limited to be construction geometry. However, they don't occur on a TechDraw page.

aapo, do you care to take a look, why such points are omitted? I attach a file with real points in the corners. It would be great if they could occur in TechDraw too.
aapo wrote: ping
Attachments
realPoints.FCStd
(5.17 KiB) Downloaded 110 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

Re: TechDraw without limits = Layout autocad

Post by aapo »

chrisb wrote: Tue Jan 19, 2021 11:56 pm We have now a new feature in Sketcher: Points are no longer limited to be construction geometry. However, they don't occur on a TechDraw page.

aapo, do you care to take a look, why such points are omitted? I attach a file with real points in the corners. It would be great if they could occur in TechDraw too.
Hmm, thanks for the test file, it really highlights the problem. I'm currently not at my developing computer, but I think I remember where the problem lies: ShapeExtractor.cpp collects all the geometry (OCC shapes) for the OCC projection, and it hoovers everything from the objects, and filters in (a) any shape volumes, and (b) any shape edges (i.e. basically wires etc) and combines them into the projection list for OCC. That means, that any points are omitted before the OCC projection, and subsequently all points in TD Views are endpoints of edges or corners of faces. In principle, it should be rather simple to just filter in (c) any points, but in practice that could cause severe headache due to unforeseen consequences. The recent fix to filter out Datum objects from TD ShapeExtractor.cpp comes to mind, it turned out to be not quite as simple as I originally thought, even though a good solution was found in the end.

At the moment, I'm thinking that the goal should be to filter in only points in Sketches and Draft objects. I'll have to test simply including all points (much simpler to program), as it could turn out to actually work: At least there should not be loose points in PartDesign bodies or parts. Datum points would probably be ok to include in TD Views? I guess the problems could occur with various FEM data obejcts, surface point clouds, etc, and any more exotic FC objects.

EDIT: One additional problem with using Sketches with TD View sources is that the "Detail Highlight View" function is not compatible with Sketches, because it needs 3D objects. I've thought about fixing that, but it'd need quite large code and algorithm changes, which are quite difficult. Basically, the 3D cutting algorithm should be replaced with 2D cutting algorithm. It'd also be faster, because in Detail View there's no need to re-do the 3D -> 2D projection done in the original View.
domad
Veteran
Posts: 2053
Joined: Mon Jun 22, 2020 12:16 pm

Re: TechDraw without limits = Layout autocad

Post by domad »

chrisb wrote: Tue Jan 19, 2021 11:56 pm Sorry for being late to this party. I think this post is worth not to be forgotten, so it would be great if you could extend it for a "TechDraw for experienced users" tutorial in the wiki.
.................
Good morning to the Community!

Thanks for the appreciation (!), Dear @chrisb just like that (!) Unfortunately the points of "Sketcher" and also those of "Draft", I don't know why, are not detected by TechDraw.
I hope your exhortation to the developers can solve the problem, which as you have been able to highlight would further simplify the use of this technique.
I will try to carry out your exhortation and publish a specification on the wiki (I confess I have never done so, but I will do everything, after studying / learning how to do it, to "obey" your prompting).
I hope now we are all in agreement in saying that TechDraw is mature and no longer places any limits on the development of highly specialized and detailed technical drawings, helping to place, even in this case, FreeCad among the best and most powerful in the C.A.D. worldwide …… and moreover open / free !!
Good work and experimentation to all!
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: TechDraw without limits = Layout autocad

Post by chrisb »

I would not include any DatumPoints into TechDraw. They are helpers for constructing the solids and usually only the solids are interesting. If no other DatumPoints are present in the body, an additional DatumPoint could be helpful for the purposes domad describes in his process.
But allowing them in general, we may end with a bunch of points somewhere in the drawing.

Another point (haha) to consider is backwards compatibility.
I am not at all for never beaking backwards compatibility, but in this case it may not be what is desired in the future too. This may be different with Draft points, which are probably used in constructions, e.g. as endpoints for lofts or sweeps.

Safest would be to use only Sketcher points. They didn't exist before and thus cannot occur in old models. And they never occur just like this, but only if the user actively makes them real points.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
domad
Veteran
Posts: 2053
Joined: Mon Jun 22, 2020 12:16 pm

Re: TechDraw without limits = Layout autocad

Post by domad »

chrisb wrote: Wed Jan 20, 2021 9:12 am I would not include any DatumPoints into TechDraw.
.......
.... yes, yes, yes, I fully agree and support your determination, the DatumPoints must remain so, however you could create a specific "point" for the functions from Draft -> TD, but I also consider this superfluous because you can use the "Creates a facebinder" + "Creates a 2D projection" and "Draft to sketch" functions to transfer the work to the "Sketcher" Workbench and obtain the "base-sketchTD" for TechDraw.
In my humble opinion the "base-sketchTD" (to understand) should have a pre-denomination and a well-defined icon to avoid confusion in the structure. Certainly the "point" object of "Sketcher" must be verticalized and made visible to TechDraw.

Another important thing to highlight is the TD function -> "Insert a Draft view" which apparently would become useless, but it is not so because it is important for the (3D) dimensioning of the axonometries in TechDraw.
This function allows us to insert the dimensions created with the "Creates a dimension" function of Draft in TechDraw and then, using the "View" and "Data" properties, align them perfectly to the sides of the axonomy (whatever it is). For this I invite you to see / read this:
https://forum.freecadweb.org/viewtopic.php?f=28&t=53848
if you see fit I can translate the "workflow" and post it in the TechDraW Forum.
Post Reply