Arch/Bim Wall Bug?

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Outsourced
Posts: 81
Joined: Wed Feb 03, 2021 8:07 am

Re: Arch/Bim Wall Bug?

Post by Outsourced »

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 +99 (Git)
Build type: Release
Branch: Branch_0.19.3
Hash: 6530e364184ce05ccff39501e175cf2237e6ee4b
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/Australia (en_AU)


When you offset a wall(s) that has multiple directions, the left ctr right alignment becomes arduous & the risk of constraint breaking in-turn losing parametric function is increased. 'Ask me how I know this'.

Continuing with the ctr alignment using the Grid in sketch 01, and walls (Ctr Align) in Sketch 02. I approached using this method to indeed overcome TPN. And keep the this version of the drawing to 19.3 alone no backwards compatibility issues insured.

All was going seemingly ok until I got to my 1 & only void. see video
https://youtu.be/bOHDnWDMDXY

As I have said previously the definition of a bug is doing something an alternative way when it could be done simpler or the right way!
(I don't say that with python knowledge I have no idea the amount of code past -I am certainly not trying to be disrespectful. But I do say that with knowledge of CAD and how many God dam packages are out there & truly wish for FC to set & be the primary standard)

File included extra strange Bug
https://drive.google.com/file/d/1MdUoCY ... sp=sharing
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Arch/Bim Wall Bug?

Post by paullee »

Outsourced wrote: Fri Mar 18, 2022 4:41 am All was going seemingly ok until I got to my 1 & only void. see video
https://youtu.be/bOHDnWDMDXY

As I have said previously the definition of a bug is doing something an alternative way when it could be done simpler or the right way!
(I don't say that with python knowledge I have no idea the amount of code past -I am certainly not trying to be disrespectful. But I do say that with knowledge of CAD and how many God dam packages are out there & truly wish for FC to set & be the primary standard)

File included extra strange Bug
https://drive.google.com/file/d/1MdUoCY ... sp=sharing
This is definitely a bug :)

And it seems it all happens with there is a 'self-intersecting wire' - when I setback the segment of wall by 55mm, everything seems fine.

Hope there is someone or when there is a gap this bug can be fixed :D


9_35_Bexley_Rd_(1)_18.03.22_r.FCStd
(361.51 KiB) Downloaded 31 times
Screenshot from 2022-03-19 12-21-42.png
Screenshot from 2022-03-19 12-21-42.png (302.83 KiB) Viewed 1526 times
Screenshot from 2022-03-19 12-21-53.png
Screenshot from 2022-03-19 12-21-53.png (299.92 KiB) Viewed 1526 times
Screenshot from 2022-03-19 12-22-48.png
Screenshot from 2022-03-19 12-22-48.png (283.61 KiB) Viewed 1526 times
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Arch/Bim Wall Bug?

Post by Roy_043 »

paullee wrote: Sat Mar 19, 2022 4:25 am Hope there is someone or when there is a gap this bug can be fixed
A fix that can work is to calculate the base face of a multi-segment wall per segment and then merge those faces. The solution seems to work for the examples presented here.

In the attached ZIP:
ArchWall.py (...\Mod\Arch\ArchWall.py)
faces.py (...\Mod\Draft\draftgeoutils\faces.py)

The bind function in faces.py was updated.
Attachments
ArchWall.zip
(20.47 KiB) Downloaded 38 times
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Arch/Bim Wall Bug?

Post by paullee »

Roy_043 wrote: Sat Mar 19, 2022 9:50 am A fix that can work is to calculate the base face of a multi-segment wall per segment and then merge those faces. The solution seems to work for the examples presented here.

In the attached ZIP:
ArchWall.py (...\Mod\Arch\ArchWall.py)
faces.py (...\Mod\Draft\draftgeoutils\faces.py)

The bind function in faces.py was updated.
Great ! Indeed, seems in earlier version something similar was made but it fails in some version later. Recently I drop into cases I find faces has opposite normal do not merge. But I do not have time to have further investigation if the latter was the problem.

Would study your fix and learn more :D
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Arch/Bim Wall Bug?

Post by paullee »

That is clever to zip those edges and create face for each pair of them 8-)

Code: Select all

        for (edge1, edge2) in zip(w1.Edges, w2.Edges):
            face = create_face(edge1, edge2)
            if face is None:
                return None
            face_list.append(face)
        return concatenate(face_list[0].fuse(face_list[1:]))
Can you enlighten why after all the faces have been fused needs 'concatenate' ? I can't figure this out, thanks :D
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Arch/Bim Wall Bug?

Post by Roy_043 »

paullee wrote: Sat Mar 19, 2022 11:54 am why after all the faces have been fused needs 'concatenate' ?
The fuse operation produces a shape with multiple faces.

The proposed code needs more work. It fails if the wall trace is a closed wire. Which is of course a rather basic case.
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Arch/Bim Wall Bug?

Post by paullee »

Would remove splitter work ?
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Arch/Bim Wall Bug?

Post by Roy_043 »

paullee wrote: Sat Mar 19, 2022 12:57 pm Would remove splitter work ?
concatenate is used in upgrade.py, and that is why I selected it, but removeSplitter also works here. See the attached, improved, faces.py file. For single segment closed wall traces using fix is still required. But I think that that should happen in the bind function.
Attachments
faces.py
(9.38 KiB) Downloaded 36 times
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Arch/Bim Wall Bug?

Post by paullee »

Thanks taking time checking this problem and provide solutions, not having time to actually tested the actual result though :)
Roy_043 wrote: Sat Mar 19, 2022 12:45 pm ... It fails if the wall trace is a closed wire. Which is of course a rather basic case.
Roy_043 wrote: Sat Mar 19, 2022 2:48 pm For single segment closed wall traces using fix is still required. But I think that that should happen in the bind function.
I have checked the codes and still no understand what you are referring to, can you slightly elaborate.

Thanks.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Arch/Bim Wall Bug?

Post by Roy_043 »

In my previous proposal (see the ZIP file) I had this line commented out in ArchWall.py:

Code: Select all

                                sh.fix(0.1,0,1) # fixes self-intersecting wires
But the handling of closed wires in the bind function in the accompanying faces.py file remained unchanged. And for closed wires fix was therefore still required. See below.

In the new version of the bind function, closed wires can also optionally be handled per segment. Only if per_segment=False, or if they have a single segment, is the old code used.
This line:
face = Part.Face([w1, w2])
Always produces a faulty face (actually it produces a shape).
And this is required:
face.fix(0.1, 0, 1)
IMO fix should be called in the bind function, not in ArchWall.py.
Post Reply