Arch depends on obsolete drawing workbench

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Arch depends on obsolete drawing workbench

Post by adrianinsaval »

I do not compile FreeCAD with Drawing Workbench as it has been said to be obsolete for years now, I don't usually use arch so I never noticed any issues (apparently the few times I did I never used my compiled version). Today I tried to crate an arch wall and I got this in report view:

Code: Select all

`17:49:58  Traceback (most recent call last):
  File "/opt/freecad/Mod/Arch/ArchWall.py", line 952, in execute
    self.applyShape(obj,base,pl)
  File "/opt/freecad/Mod/Arch/ArchComponent.py", line 941, in applyShape
    self.computeAreas(obj)
  File "/opt/freecad/Mod/Arch/ArchComponent.py", line 975, in computeAreas
    import Drawing,Part
  File "/usr/lib/python3.10/site-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
<class 'ModuleNotFoundError'>: No module named 'Drawing'`
Does arch really need to depend on Drawing workbench? is there no equivalent elsewhere for the projection function used there?

line were drawing is imported:
https://github.com/FreeCAD/FreeCAD/blob ... nt.py#L975

then the only place were it is used in that file:
https://github.com/FreeCAD/FreeCAD/blob ... t.py#L1011
OS: Linux 5.16.8-arch1-1 (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.27465 (Git)
Build type: Release
Branch: master
Hash: 092afacfcb5127eb67c385a43cbe34a4cd15bef4
Python version: 3.10.2
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United Kingdom (en_GB)
User avatar
Roy_043
Veteran
Posts: 8552
Joined: Thu Dec 27, 2018 12:28 pm

Re: Arch depends on obsolete drawing workbench

Post by Roy_043 »

Both the Arch WB and the Draft WB still rely on code from the Drawing WB.

In the Arch WB Drawing code is used to calculate the horizontal projection of Arch Components. I have recently tried to look at this. One idea is to use TechDraw.findShapeOutline(). See: https://forum.freecadweb.org/viewtopic.php?f=35&t=66135. In short we need code that can efficiently project 'random' faces onto the XY plane. Or, alternatively, can calculate the area enclosed by the vertical faces of a wall type solid.

In the Draft WB Drawing code is used by the Draft Shape2DView command. This command is important for the current Arch/BIM workflow. It is used to create 2D representations that are an intermediate step between the 3D model and TechDraw drawings.
User avatar
wandererfan
Veteran
Posts: 6320
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Arch depends on obsolete drawing workbench

Post by wandererfan »

adrianinsaval wrote: Fri Feb 11, 2022 9:55 pm Does arch really need to depend on Drawing workbench? is there no equivalent elsewhere for the projection function used there?
Drawing.project() is now available as TechDraw.project(), as are all (?) other Drawing projection related functions. See git commit cc770208ea for details.

The equivalent of the Drawing ProjectShape command is now available in the TechDraw toolbar.
User avatar
Roy_043
Veteran
Posts: 8552
Joined: Thu Dec 27, 2018 12:28 pm

Re: Arch depends on obsolete drawing workbench

Post by Roy_043 »

There are some more places where Drawing code is used in the Draft WB. I'll try to make a list.
Good news: Already fixed for the Draft WB by @marioalexis84.
https://github.com/FreeCAD/FreeCAD/pull/6406
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: Arch depends on obsolete drawing workbench

Post by adrianinsaval »

Thanks guys! FOSS and FreeCAD are awesome :)
Post Reply