FreeCAD
FreeCAD copied to clipboard
BIM: add Offset input to wall creation task panel
When creating a wall via the Task panel, add the ability to enter a value for the Offset property.
Offset input is disabled when Align is set to Center. This is simply for visual purposes and user awareness, since it is possible to enter an Offset with Align set to Center in the Property Editor, yet the offset will be ignored in this case.
This PR does a small refactor of variable names used for creating the Task panel widget that is not strictly necessary for the feature. However, it was applied to improve readability and it's contained within a small set of local variables inside the taskBox() method.
Notes:
- A new
WallOffsetparameter is added, which acts in the same way as other parameters related to wall dimensions, such asWallHeight. For the user, it enables saving the state of the Offset value across different invocations of the new wall Task panel - The workflow to finish wall creation upon entering Enter on the wall Height input has been kept. But additionally, with the Offset input focused, pressing Enter will also create the wall.
Known issues:
- This PR is functional, but it outputs a
<class 'RuntimeError'>warning (without any additional context) the first time a wall is created. It does not seem to affect functionality. Update: this does not seem to be specific to this PR, though.
Issues
Fixes: #21032
Before and After Images
| Before | After |
|---|---|
After (input disabled when Alignment is set to Center)
The functionality is there now. ~Leaving it as a draft PR for now until I figure out the warning listed under Known issues~. Update: it does not seem to be related to this PR. I'm getting the warning also on a fresh build from main.
I'm also thinking of changing the behaviour of pressing Enter when the Offset input box has focus, so that it creates the wall instead of keeping the Task panel open. @kaiwas, thoughts?
I'm also thinking of changing the behaviour of pressing Enter when the Offset input box has focus, so that it creates the wall instead of keeping the Task panel open. @kaiwas, thoughts?
I have no idea about that. It seems that Enter had previously confirmed the creation of a wall, some field was not in focus.
Current behaviour
The way it worked previously (before this PR):
- Click on
Arch_Wallcommand. The Task panel shows up - Press the Tab key to navigate through the input fields with the keyboard, until you reach the
Lengthfield - Once you're there, the sequence to create a wall with keyboard input is:
Length => optionally enter value, press Enter. The focus and cursor are set to the next field (Width) ↓ Width => optionally enter value, press Enter. The focus and cursor are set to the next field (Height) ↓ Height => optionally enter value, press Enter. The Task panel is closed and the wall is created. Alternatively, if Tab is pressed, the cursor is set to the next field (Alignment)
New behaviour
The way it works on this PR:
1 to 3. Same steps and behavior. On step 3, press Tab to switch to the Alignment field 4. On Alignment, optionally change value and press Tab to switch to the Offset field 5. On Offset, pressing Enter ~does not create the wall and close~ creates the wall and closes the Task panel.
~So I'm thinking that perhaps on step 5 pressing Enter should create the wall, in the same way it happens on the Height input field.~ Edit: this comment has been updated according to https://github.com/FreeCAD/FreeCAD/pull/21042#issuecomment-2849467180
So I'm thinking that perhaps on step 5 pressing Enter should create the wall, in the same way it happens on the Height input field.
It's all very confusing ) In my opinion, "wall parameters" (width/height, etc.) should be at the first stage. But this does not correspond to all other BIM/DRAFT tools. Despite the fact that coordinates are very important - most often we first have to adjust the wall parameters and only then place them in space.
But this is unlikely to concern the current issue. This task is conceptual and rather relates to design and usability issues.
You probably know that in other programs, wall parameters and their "placement" in space are separate actions. In FreeCAD, everything is mixed up in one heap with many input fields. Such a solution cannot be convenient.
More precisely, there is no indication of the coordinates of the first and second points)
1 to 3. Same steps and behavior. On step 3, press Tab to switch to the Alignment field 4. On Alignment, optionally change value and press Tab to switch to the Offset field 5. On Offset, pressing Enter does not create the wall and close the Task panel.
So I'm thinking that perhaps on step 5 pressing Enter should create the wall, in the same way it happens on the Height input field.
I agree with your proposal. It seems consistent with the current workflow.
It's all very confusing ) In my opinion, "wall parameters" (width/height, etc.) should be at the first stage. But this does not correspond to all other BIM/DRAFT tools. Despite the fact that coordinates are very important - most often we first have to adjust the wall parameters and only then place them in space.
But this is unlikely to concern the current issue. This task is conceptual and rather relates to design and usability issues.
You probably know that in other programs, wall parameters and their "placement" in space are separate actions. In FreeCAD, everything is mixed up in one heap with many input fields. Such a solution cannot be convenient.
More precisely, there is no indication of the coordinates of the first and second points)
It would be interesting to open a thread on the forum to discuss about design and usability of wall tool . But maybe I would wait for Yorik's refactor ( Redesign the wall tool to by default work without a baseline ) .
Separating the wall parameters from their "positioning" in space would make everything much simpler.
Actually, even in Freecad we can already use this workflow. I create sketch or line in draft workbench and then I create the wall. The problem arises when I have to edit and then search for the wall parameters among all the properties. Being able to activate the wall options tool of an existing wall would be awesome.
I've changed the behaviour so that in addition to pressing Enter when the Height input has the focus, pressing Enter when the Offset input has the focus will also create the wall.
@furgo16 PR has a conflict. @FreeCAD/design-working-group FYI
It's fine for me. Waiting for DWG
Nice feature, thanks!
Would it be possible for the wireframe preview to represent the correct placement of the wall when the Offset distance is > 0? Currently, the wireframe preview is moved to the right or left depending on the Alignment option, but not offset, the wall is correctly offset after creation:
Would it be possible for the wireframe preview to represent the correct placement of the wall when the Offset distance is > 0? Currently, the wireframe preview is moved to the right or left depending on the Alignment option, but not offset, the wall is correctly offset after creation:
Thanks for the review and nice catch! I'd be happy to look into it, but perhaps as a follow-up PR to this one. I'll need to find out how the wireframe preview is created first. @yorikvanhavre would you have any pointers for where to look at?
That wireframe visualisation is a Draft box tracker (in Draft/draftguitools/gui_trackers.py) Here it's probably just a matter of taking the offset into account when updating the tracker start/endpoints under https://github.com/FreeCAD/FreeCAD/blob/main/src/Mod/BIM/bimcommands/BimWall.py#L256
@yorikvanhavre @furgo16
I want to mention that the beam (concrete) preview is also incorrect. Maybe it's worth fixing this everywhere?
@kaiwas yes, that's https://github.com/FreeCAD/FreeCAD/issues/16331 and it's a more serious issue in my opinion. It was on my mind when I saw @marcuspollio's remark, but I'm not yet sure whether it's beyond my skills to tackle it.
Indeed the precast elements were never really made to have a preview... It's probably a bit more work