Arch Shape2D view cyclic dependency

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Arch Shape2D view cyclic dependency

Post by yorik »

Okay I see better. You are dimensionning the Shape2Dview, which is the product of the section plane, which needs these very dimensions. there's indeed an impossibility there.

I would rather 1) either dimension the 3D objects directly, or 2) add a "dummy" object (for example a Part -> simple copy) that you use to make dimensions. Solution 1) is better, though, because in 2) the dummy object is not updated if something changes.

Nice model BTW!
brjhaverkamp
Posts: 126
Joined: Thu Sep 24, 2015 3:14 pm

Re: Arch Shape2D view cyclic dependency

Post by brjhaverkamp »

Hi Yorik,

Thanks for looking at my model. I understand now it is a workflow issue on my side. I had to look into and learn about snapping to workplane, but I think I got the trick now.

I'm still struggling with snapping. For some reason I loose the ability to snap sometimes. I'm sure it is something I do wrong, but I haven't gotten finger behind it. Saving, stopping, restarting solves it for sure. Just need to find out what I do wrong

This also solves my problem on how to map a shape2Dview to section plane. A shape2Dview is normally placed on the xy plane. But in order to move it to the YZ plane for instance, it needs to be rotated over 2 axis. I had to get my matrix geometry out and calculate the resulting rotation matrix and convert that back to axis/angle. It was fun for once and it worked, but it is nuisance to do it everytime;-).
But now I realise I don't need a Shape2Dview at all.

One question though: Is there an easy way to set the working plane to an existing Section plane?

Kind regards,

Bert
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Arch Shape2D view cyclic dependency

Post by yorik »

brjhaverkamp wrote: Mon Apr 01, 2019 11:23 am One question though: Is there an easy way to set the working plane to an existing Section plane?
No, but that would be a good feature to add. At the moment you can do it via python like this (with the section plane selected):

Code: Select all

FreeCAD.DraftWorkingPlane.setFromPlacement(FreeCADGui.Selection.getSelection()[0].Placement,rebase=True)
FreeCADGui.Snapper.setGrid()
brjhaverkamp
Posts: 126
Joined: Thu Sep 24, 2015 3:14 pm

Re: Arch Shape2D view cyclic dependency

Post by brjhaverkamp »

Thx Yorik,

I thought your suggested workflow made it unneeded, but now think I will need to use a Shape2Dview anyways to add dimensions on a sectionplane anyways.(Still cleaning up other parts of the model atm) I want to add measurements at e.g. 1.5m height under the roof. On the real model there is nothing to snap to, so I need a cross-section Shape2Dview to mark the roof at this height.
Adding the Shape2Dview at the right place on the XY plane is fairly simple, but on any other plane it is painful due to the rotation.

btw, in https://www.freecadweb.org/wiki/Draft_Shape2DView I read about an "in place" property. The description sounds exactly like this. But it doesn't seem to work for me. Am I misunderstanding the purpose, or is it just not working? Also I fail to see why it should be limited to "Cutlines" or "Cutfaces", so probably I am misreading it completely:-)

Bert
brjhaverkamp
Posts: 126
Joined: Thu Sep 24, 2015 3:14 pm

Re: Arch Shape2D view cyclic dependency

Post by brjhaverkamp »

Hello Yorik,

I'm back to the attic drawing from a while back, trying to clean up the techdraw and dimensions. In the thread above you mentioned it is best to link the dimensions to the 3D model directly, in order to avoid the cyclic dependency.

I am trying to take that approach. But I am running into an obstacle. I need to create the inner room dimensions at 1.5m height from the floor. So I need to snap to the intersection between the sectionplane and the inside of the roof. But this is hidden under the rest of the roof. Also I am not sure how to snap to such an intersection, is that even possible? What is the best approach?

Related, the python code works nicely. But did you get arround to implementing setting the workplane to an section plane by chance?
I don't want to leave this forgotten. What is the best way to keep track of such items. Should I add a bugreport?

Kind regards,

Bert
brjhaverkamp
Posts: 126
Joined: Thu Sep 24, 2015 3:14 pm

Re: Arch Shape2D view cyclic dependency

Post by brjhaverkamp »

Quick followup:

For a moment, I thought I solved the problem by setting a clipping view.
However, the clipping view does not stay on.
When I set the right z height in the dialog, all looks well. But I don't see a confirmation button. Only a close button and when hitting that one, the clipping is gone again. What am I missing?

Regards,

Bert
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Arch Shape2D view cyclic dependency

Post by vocx »

brjhaverkamp wrote: Mon May 13, 2019 1:26 pm ...

I am trying to take that approach. But I am running into an obstacle. I need to create the inner room dimensions at 1.5m height from the floor. So I need to snap to the intersection between the sectionplane and the inside of the roof. But this is hidden under the rest of the roof. Also I am not sure how to snap to such an intersection, is that even possible? What is the best approach?
Normally with the Draft Snap methods you can use something like Draft Near.

It's difficult to know what you want. You probably should post a picture so people understand what you want, and don't have to load the entire model.
Related, the python code works nicely. But did you get arround to implementing setting the workplane to an section plane by chance?
I don't want to leave this forgotten. What is the best way to keep track of such items. Should I add a bugreport?
Normally you can select a face and click on Draft SelectPlane to position the working plane in that place. However, you are right, this doesn't seem to work with an Arch SectionPlane. You could maybe create a simple filled Draft Rectangle exactly at the same position of the SectionPlane. Then select the face of the rectangle and use Draft SelectPlane.

If you plan to use this plane many more times you should probably create a Draft SetWorkingPlaneProxy. This will save the position of the working plane, and you can restore it by selecting it and using Draft SelectPlane again.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
brjhaverkamp
Posts: 126
Joined: Thu Sep 24, 2015 3:14 pm

Re: Arch Shape2D view cyclic dependency

Post by brjhaverkamp »

Hi Vocx,

I was hoping the description was sufficient, given the long thread.
I am trying to create a drawing with the inside measurements of the new attic at a height of 1.5m (the usefull space)
Screenshot (37).png
Screenshot (37).png (519.53 KiB) Viewed 581 times
In the attached picture you can see what I want to accomplish. In this picture I have clipped the top off, at 1.5m exactly. And in order to create the dimensions shown, I have snapped to the Shape2Dview.

These are 2 things I don't want/can't. When in clipping mode, there is no way to add dimensions. (all the buttons are greyed out) and snapping to the shape2Dview gives a cyclic dependency.

But without clipping, it is very hard to get to the exact snapping spot. and on top, even if I use wireframe mode to get to the inside of the model, I need to snap to the intersection of a line with the sectionplane.

Is this the only way to do this, or is there a better way of working?

For clarity, below is the same model without clipping:

Regards,

Bert
Screenshot (38).png
Screenshot (38).png (338.92 KiB) Viewed 581 times
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Arch Shape2D view cyclic dependency

Post by yorik »

brjhaverkamp wrote: Mon May 13, 2019 1:26 pm Related, the python code works nicely. But did you get arround to implementing setting the workplane to an section plane by chance?
I don't want to leave this forgotten. What is the best way to keep track of such items. Should I add a bugreport?
I just did it! git commit a7cb6ed62

As for the Shape2Dview's normal mode staying "in place", like the CutFaces and CutLines modes, indeed, why not... The problem is more technical. The CutFaces and CutLines provide geometry that is already in place (using a boolean section) while the Solid mode gives a result that is already in the XY plane.

But I think the displacement vector could be found by taking a vector from the (0,0,0) origin perpendicularly to the section plane... I'll test that
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Arch Shape2D view cyclic dependency

Post by vocx »

brjhaverkamp wrote: Tue May 14, 2019 12:22 am ...
I am trying to create a drawing with the inside measurements of the new attic at a height of 1.5m (the usefull space)

In the attached picture you can see what I want to accomplish. In this picture I have clipped the top off, at 1.5m exactly. And in order to create the dimensions shown, I have snapped to the Shape2Dview.
...
As I said previously, I would add a Draft Rectangle with the Make face property set to true. I'd displace the rectangle 1.5 m in the Z direction so it is at the right position. Then I'd use Draft SelectPlane to set the working plane and grid on that place exactly. Then I'd draw the dimensions on that working plane, attaching the dimensions to the grid, not to the planes or your geometry. As long as the grid resolution is small enough, if the dimension points are near the walls' intersections, it will look fine.

At first I thought you were dimensioning the intersection of the slanted roof with the plane, so its projected length varies depending on the position of the intersecting plane. But now I think you are always measuring the straight walls, so the lengths are constant.

As Yorik just improved the code, it seems in the future you won't need to use an auxiliary plane to set up the working plane, you can just use the Arch SectionPlane itself. But the advice still stands, snap to the grid.
FreeCAD_Draft_rectangle_SelectPlane.png
FreeCAD_Draft_rectangle_SelectPlane.png (89.82 KiB) Viewed 572 times
These are 2 things I don't want/can't. When in clipping mode, there is no way to add dimensions. (all the buttons are greyed out) and snapping to the shape2Dview gives a cyclic dependency.

But without clipping, it is very hard to get to the exact snapping spot. and on top, even if I use wireframe mode to get to the inside of the model, I need to snap to the intersection of a line with the sectionplane.
Don't snap to the intersection of the Shape2DView, nor to the intersection of the wall. Snap to the grid. Position the grid correctly, and make it fine enough, so your dimensions are taken within a 0.01 m tolerance of the real intersection. For the walls of a building, you don't need as much precision anyway, because the constructed wall may be marginally thicker or thinner due to things like wallpaper, finish, plaster, etc.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Post Reply