Generation of 3D objects and location, ventilation ducts

Need help, or want to share a macro? Post here!
Post Reply
Posts: 1
Joined: Fri Sep 17, 2021 11:13 am

Generation of 3D objects and location, ventilation ducts

Post by mluser »

Is this possible?

The starting point is that you have a one-storey house, which is a 3D volume. In that house there are 3 rooms with a narrow common corridor. The idea is to draw 2 separate ventilation ducts that have different dimensions, from room 1 to room 3 via the common corridor, at the top near the ceiling.

On the one hand, the two ventilation ducts should not collide with each other, nor should they be too close to the ceiling or corridor walls. Of course, I want the ventilation ducts to be as high as possible to maximize the free height under the ventilation ducts. But the problem is that the corridor where the ventilation ducts should run is limited in width (say 1.2 meters), so the ventilation ducts need to be dimensioned in relation to the width of the corridor, as well as in relation to the other ventilation duct that has a different dimension. The dimension or rather cross-sectional surface of the ventilation duct will be calculated on the air speed of the duct (which is based on the airflow specified by the user, or inserts into the script).

You may use GUI to manually draw the one-storey house, the rooms, the corridor and available space (or width) where your ventilation ducts should run, but the rest should only be done via script/programming in FreeCAD.
Is this even possible?
Posts: 2651
Joined: Thu Apr 05, 2018 1:53 am

Re: Generation of 3D objects and location, ventilation ducts

Post by TheMarkster »

Here is what I have come up with, which might be helpful or might not be, but it was an interesting diversion.

If you can make the ducts rectangular and you can control the width and height (as opposed to needing to buy components of a certain size) then you can calculate width and height for each duct to minimize on the duct heights (to get more headroom for people walking through the corridor). Circular ducts will be far less economical in terms of headroom space saved.

The dd object contains the variables:

A1 = desired cross-section area of duct 1
A2 = desired cross-section area of duct 2
H = shared height of ducts. They will both be same height, but the widths will differ depending on desired Area.
Clearance = the amount of clearance needed around each duct between ducts, the walls, the ceiling. (currently set at 50mm)
CorridorWidth = the width of the corridor (1200 mm)

Experiment with different values for A1 and A2 to see how it works.
Snip macro screenshot-070a44.png
Snip macro screenshot-070a44.png (130.76 KiB) Viewed 417 times
Sketch is on the XZ plane. Imagine you are walking through the corridor. This view is the cross-section of the ducts overhead.
Snip macro screenshot-a250de.png
Snip macro screenshot-a250de.png (62.66 KiB) Viewed 417 times
Snip macro screenshot-74ef24.png
Snip macro screenshot-74ef24.png (6.47 KiB) Viewed 417 times
The sketch can't be padded or anything as is, but rather should be used as a master sketch from which other sketches can be referenced. You could then use a tool such as Loft to create the 3D model.

Edit: The 1050 in the formulas is based on the 1200 - 3 * 50 clearance. It should not be hard-coded, but rather should be (corridor width - 3 * clearance)
(17.36 KiB) Downloaded 17 times
My FreeCAD video series on youtube:
Post Reply