Connect two face and fill empty espace

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Connect two face and fill empty espace

Post by ebrahim raeyat »

Hello everyone, I wonder how I can connect two or more faces at one point and then fill in the remaining space. I think of this process:

Extend all faces enough to meet each other. Then calculate the common part of all the faces. Then add the common part anyway and create a new face from the old face and the common part. Is there an easier way?
connect.png
connect.png (19.7 KiB) Viewed 7386 times
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Connect two face and fill empty espace

Post by ebrahim raeyat »

I did it with my idea:
connect.png
connect.png (27.4 KiB) Viewed 6788 times
but I am wonder if there is an easier solution.

although it has bug in some cases, in below picture, there are 3 rectangle that I extended those and then obtain the common part and add it to main shape of foundation. one solution is to cut each rectangle with common shape, But I want to know if there is an another solution.
connect2.png
connect2.png (19.81 KiB) Viewed 6788 times
User avatar
ragohix769
Posts: 565
Joined: Sat Jul 18, 2020 7:04 am
Location: Rome - Italy

Re: Connect two face and fill empty espace

Post by ragohix769 »

Great idea.

I think the main thing is working in 2D in the process to obtain faces in holes between edges/objects making some 2d offset and then boolean intersection to create new faces. The problem is, as I see too in your example, some offset can create problems, and this process cannot be automated easily.
After #ElonMuskBuyTwitter I'm no more on Twitter, that's really enough :-(
=> Now you can find me here on #Mastodon: https://mastodon.uno/@opensoul - I hope more people do the same :-)
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Connect two face and fill empty espace

Post by paullee »

Can you elaborate the algorithm please ? :)
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Connect two face and fill empty espace

Post by ebrahim raeyat »

paullee wrote: Tue Oct 12, 2021 1:44 pm Can you elaborate the algorithm please ? :)
step 1 - I have some rectangle that meet each other in one point (it is not matter here)
step 2- I extend each rectangle with significant length (for example 3 meter or higher)
step 3- I obtain common part of face and add it to the original rectangles (in step 1)
connect.png
connect.png (24.13 KiB) Viewed 6638 times
but there is situation that this algorithm did not work:
connect2.png
connect2.png (16.04 KiB) Viewed 6638 times
one solution is in step 3, I obtain common part and other part that in original faces and then add common part and new faces for each rectangle, but i want to know is there an easier solution? thanks.
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Connect two face and fill empty espace

Post by paullee »

Not a direct answer to problem :

ArchWall build wall base on wire. It use DraftGeomUtils.offsetWire to offset each segment of wire, and connect each offset segment to form the baseplate, similar to effect you are looking for.

Check getExtrusionData(self,obj) in https://github.com/FreeCAD/FreeCAD/blob ... rchWall.py

Image
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Connect two face and fill empty espace

Post by ebrahim raeyat »

paullee wrote: Thu Oct 14, 2021 5:08 pm Not a direct answer to problem :
Thanks paullee. I also checked the wall Gui, but i can't find the tools that connect two walls. In BIM WB, I saw the corner join that gives only two walls and still in my situation, did not work.

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Connect two face and fill empty espace

Post by paullee »

I mean you can check the algorithm in ArchWall particularly the DraftGeomUtils.offsetWire.

In fact, just make a sketch of your 'beam' layout and click ArchWall, just adjust the Height and Width to imitate the beam layout.

Test_ ArchWall_ as Beam.FCStd
(12.89 KiB) Downloaded 82 times
Screenshot from 2021-10-18 22-51-33.png
Screenshot from 2021-10-18 22-51-33.png (193.82 KiB) Viewed 6246 times
Screenshot from 2021-10-18 22-52-28.png
Screenshot from 2021-10-18 22-52-28.png (206.88 KiB) Viewed 6246 times
User avatar
ebrahim raeyat
Posts: 619
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: Connect two face and fill empty espace

Post by ebrahim raeyat »

paullee wrote: Mon Oct 18, 2021 2:55 pm I mean you can check the algorithm in ArchWall particularly the DraftGeomUtils.offsetWire.

In fact, just make a sketch of your 'beam' layout and click ArchWall, just adjust the Height and Width to imitate the beam layout.
Thanks paul lee. In my case, If I align the walls to left (or right), the problem occurs, but thanks to you. I will study the code and examine my another idea and then will tell you.
wall.png
wall.png (24.09 KiB) Viewed 6212 times
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Connect two face and fill empty espace

Post by paullee »

You are welcome. In fact, I want to make a remark in last post but it turn out disappeared - ' it works in most cases but sometime it does not work as ideal". That's some cases I want to attack when there is more time later, or someone more capable can resolve it ? Good luck :)

p.s. The test you did somehow tell you how the ArchWall underlying algorithm works, and fails :lol:
Post Reply