Import dimensions from sketch to Techdraw views

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
-alex-
Veteran
Posts: 1861
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Import dimensions from sketch to Techdraw views

Post by -alex- »

Hi there,

First thanks for Techdraw WB wich is better n better everyday!
In this topic Realthunder show how he has achieved a way to link between objects in tree view and faces in 3D view: https://forum.freecadweb.org/viewtopic. ... 80#p377495
This improvement let me think about the possibility to import dimensions from sketches to techdraw views by selecting faces or edges in projected views.
However I have no skills in programing, so I have no idea about how it's a crack nut purpose...
wandererfan wrote: ping
Do you think such feature could be achieved? I mean:

- 1: import dimensions from sketches to projected views?
- 2: import dimensions by selecting relevant features in projected views?

An exemple, lets say we import below dimensions in view by selecting the normal face which results from the Pad feature:
sketch_dimensions.png
sketch_dimensions.png (27.84 KiB) Viewed 4685 times

I ask about that because this way to add dimensions save a lot of time and could be reliable, by assuming dimensions in view would be linked to the ones in sketches.

I did not find any similar topic in forum, so I ask for your opinion about that, thank you.
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Import dimensions from sketch to Techdraw views

Post by chrisb »

This has been discussed before, see issue #4181.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
wandererfan
Veteran
Posts: 6324
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Import dimensions from sketch to Techdraw views

Post by wandererfan »

-alex- wrote: Tue Mar 31, 2020 8:39 pm - 1: import dimensions from sketches to projected views?
- 2: import dimensions by selecting relevant features in projected views?
For views of sketches, this is already on the to do list. (as @chrisb noted)

For edges, this is a tough nut. We have no reference between an edge in a TD view and the corresponding edge in the 3D model. Also a edge in 3D might become several edges in the projection.

There is a python method (TechDraw.makeDistanceDim3d) that takes 2 3D points and makes a dimension in a View. A gui front end for this might give you a portion of what you want.
User avatar
-alex-
Veteran
Posts: 1861
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: Import dimensions from sketch to Techdraw views

Post by -alex- »

Thanks for replies guys,
chrisb wrote: Tue Mar 31, 2020 9:08 pm This has been discussed before, see issue #4181.
Thanks Chris ;)

wandererfan wrote: Wed Apr 01, 2020 12:53 am For views of sketches, this is already on the to do list. (as @chrisb noted)
That's great!

For edges, this is a tough nut. We have no reference between an edge in a TD view and the corresponding edge in the 3D model. Also a edge in 3D might become several edges in the projection.
You mean that Realthunder's improvements (link + toponaming algo) can't help here, right?

There is a python method (TechDraw.makeDistanceDim3d) that takes 2 3D points and makes a dimension in a View. A gui front end for this might give you a portion of what you want.
Glad to know that, however view of sketches could give me what I want, I mean if it would be possible to import sketches's dimensions in overlay with standard projected views it would do the job isn't it?
I mean we could import dimensions by selecting sketch by sketch, one after another concerning the appropriate projected view (no display of sketch needed, far from it, import dimensions only).
What do you think about that? Does it make sens?

Edit: typo
Last edited by -alex- on Tue Nov 16, 2021 9:47 pm, edited 1 time in total.
User avatar
wandererfan
Veteran
Posts: 6324
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Import dimensions from sketch to Techdraw views

Post by wandererfan »

-alex- wrote: Wed Apr 01, 2020 3:59 pm You mean that Realthunder's improvements (link + toponaming algo) can't help here, right?
That might be part of the solution, but the troublesome bit is the projection/Hidden Line Removal algorithms in OCC. The output from HLR doesn't carry a nice tidy link back to the source edges. It would take some serious reverse engineering to figure out.
Glad to know that, however view of sketches could give me what I want, I mean if it would be possible to import sketches's dimensions in overlay with standard projected views it would do the job isn't it?
I mean we could import dimensions by selecting sketch by sketch, one after another concerning the appropriate projected view (no display of sketch needed, far from it, import dimensions only).
What do you think about that? Does it make sens?
Picking a length/angle constraint and saying make a dimension in this view is likely quite possible. Assuming the projection direction aligns with the sketch normal, among other things. It would be a kind of free floating dimension, not actually linked to an edge in the drawing.
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Import dimensions from sketch to Techdraw views

Post by chrisb »

-alex- wrote: Wed Apr 01, 2020 3:59 pm You mean that Realthunder's improvements (link + toponaming algo) can't help here, right?
I'm not sure how far his toponaming improvements will go. Currently the numbering of the edges in Sketcher is different from that in the created feature. For modeling it may be even better to keep these independent, i.e. if I remove an edge and add a new one in the same place, nothing should change. But if things are connected too tightly, this may become a problem.

Please note: All this is mere guessing.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
-alex-
Veteran
Posts: 1861
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: Import dimensions from sketch to Techdraw views

Post by -alex- »

chrisb wrote: Wed Apr 01, 2020 5:15 pm For modeling it may be even better to keep these independent, i.e. if I remove an edge and add a new one in the same place, nothing should change.
Sorry Chris I'm not sure to see your point. Do you mean about such beaviour with actual topological algo or with Realthunder's one?
AFAIK Realthnder's topological algo seems me very reliable, with this algo no topological naming troubles remain for modeling.
If you add or some lines in sketch, no problem. But AFAIR if you remove some lines you will get broken references (however even in this last case there is a trick to avoid brocken reference AFAIR)
wandererfan wrote: Wed Apr 01, 2020 4:43 pm That might be part of the solution, but the troublesome bit is the projection/Hidden Line Removal algorithms in OCC. The output from HLR doesn't carry a nice tidy link back to the source edges. It would take some serious reverse engineering to figure out.
I understand, the good new is such reverse engineering is not needed if you are able to import dimensions constraints of sketches and display it in overlay mode on suitable projected views. IMHO such import feature, plus actual techdraw dimensions would allow a very reliable and full way to performe a drawing :)
User avatar
-alex-
Veteran
Posts: 1861
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: Import dimensions from sketch to Techdraw views

Post by -alex- »

wandererfan wrote: Wed Apr 01, 2020 4:43 pm Picking a length/angle constraint and saying make a dimension in this view is likely quite possible. Assuming the projection direction aligns with the sketch normal, among other things. It would be a kind of free floating dimension, not actually linked to an edge in the drawing.
"not actually linked to an edge in the drawing": yes, that's the point

abdullah wrote:ping
From sketcherWB's developer point of view, what's your opinion about the possibility to code such feature? I mean to export constraint dimensions from sketches to Techdraw projected views?
rstech
Posts: 20
Joined: Thu May 26, 2016 8:30 am

Re: Import dimensions from sketch to Techdraw views

Post by rstech »

Could it also be done with constraints? And convert them into geometric symbols? Probably very complex because I do not know any CAD software who can do this. Just thinking out loud! ;-)
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Import dimensions from sketch to Techdraw views

Post by abdullah »

-alex- wrote: Tue Nov 16, 2021 10:18 pm
wandererfan wrote: Wed Apr 01, 2020 4:43 pm Picking a length/angle constraint and saying make a dimension in this view is likely quite possible. Assuming the projection direction aligns with the sketch normal, among other things. It would be a kind of free floating dimension, not actually linked to an edge in the drawing.
"not actually linked to an edge in the drawing": yes, that's the point

abdullah wrote:ping
From sketcherWB's developer point of view, what's your opinion about the possibility to code such feature? I mean to export constraint dimensions from sketches to Techdraw projected views?
I can understand (and have discussed) a feature of reusing the constraints of the sketcher to create TechDraw dimensions. The idea I got from the power users that actually do blueprints (I do not do blueprints myself) is that good sketching practices lead to constraints in places that one would not put when creating a blueprint. They suggested that it was best to get a projection in TechDraw and create the dimensions that are necessary there.

Last year I had to do a blueprint for one room of my house. I found rather effortless to click an edge and get a dimension. This makes it even harder for me to understand why such feature would be desirable, if the information is not directly reusable.

Now, what it is shown in the first post is some kind of projection over one sketch. So the constraints are not TechDraw dimensions, but sketcher dimensions. It appears to be intended to show how to build a solid from a constrained sketch, or to show how one should constraint one sketch to create a solid.

Then I read the exchange with wandererfan, where the focus is on a "free floating dimension". I am not sure I follow this part. I do not understand what the purpose of this may be. I do not see how this would substantially speed up the creation of blueprints. But, I do not know much about blueprints.

Now, you ask about the Sketcher. There are two different sources of information that can be obtained from a Sketch. The first source, which is the main source, reflects the geometries in edit mode and is contained in two properties called Geometry and Constraints. These assume a sketch in XY plane. However, orientation can be obtained from the placement property. The second source of information is the edges that are generated from the edit mode properties (the shape). This shape contains edges(wires) and vertices, but not constraints or values of constraints.

I think that the approach that is presented in the previous post involves using the second information (the shape) and somehow try to get the constraint information and link it to this shape for representation. I think this approach may be over-complicated if what is desired is what is shown in the first post.

I think that if you want to do something in the line of the picture of the first post, it may make more sense to use the edit mode information, and transform it with the placement and projection information. But, TechDraw will need to be able to interpret all the sketcher edit mode geometry and be able to draw it (if the profile is actually necessary), or interpret it if the dimensions are only necessary.

This approach would make the toponaming improvements / reordering of edges in wires irrelevant (as far as I understand), because the edit mode sketch does not have edges or wires, but actual geometry objects (lines, circles, ellipses, ...). But, as said, representation of constraints, within the sketcher, relies on geometry information of the geometry it is applied to. This means that to draw constraints, the geometry information shall be interpreted.

As an evaluation of the effort, I will say that this is doable. I would say that there is enough information in the sketcher module to understand how this can be done. I will also say that it involves quite some work.

I am not sure this reply is what you were expecting or if it is helpful. Feel free to refine the question for more answers ;)
Post Reply