Select to view content in your preferred language

Code for noise cancelling screen with overhang

353
4
Jump to solution
04-24-2024 09:00 AM
AleksanderAStysiak
New Contributor II

Hi 

I need to create a model for Hamborg style Noise cancelling screen. 
Im struggling with creating an angled geometry on top of extruded wall. 

Any advice on how to add the orange marked extension to the green extruded wall?

I would like to be able to control the angle. Screen are usually several meters long. 

AleksanderAStysiak_1-1713974372914.png

 

 

0 Kudos
1 Solution

Accepted Solutions
plfontes
Occasional Contributor

No worries, here's an alternative compatible with the 2023.0 version:

 

/*
 * File:    screen_with_overhang.cga
 * Created: 30/04/2024
 * Author:  Patrick Fontes
 
 # This rule assumes you have the wall footprint as the initial shape
 
*/

version "2023.0"

attr screenHeight = 6
attr overhangAngle = 45
attr overhangLength = 1
attr edgeIndex = 0 //this determines the edge from where the overhang hinges 

@StartRule
Screen -->
	extrude(screenHeight)
	comp(f){side: ScreenSides. | top: OverhangHinge}
	
OverhangHinge -->
	roofShed(overhangAngle, edgeIndex)
	comp(f){aslant: OverhangExtension | side : ScreenSides. | top: OverhangExtension}
	
OverhangExtension -->
	extrude(overhangLength)

 


Cheers.

View solution in original post

4 Replies
plfontes
Occasional Contributor

One solution could be the following:

/*
 * File:    screen_with_overhang.cga
 * Created: 25/04/2024
 * Author:  Patrick Fontes
 
 # This rule assumes you have the wall footprint as the initial shape
 
*/

version "2023.1"

attr screenHeight = 6
attr overhangAngle = 45
attr overhangLength = 1
attr edgeIndex = 0 //this determines the edge from where the overhang hinges 

@StartRule
Screen -->
	extrude(screenHeight)
	comp(f){side: ScreenSides. | top: OverhangHinge}
	
OverhangHinge -->
	roofShed(overhangAngle, edgeIndex)
	comp(f){isTagged("roof.side.outer") : ScreenSides. | isTagged("roof.top"): OverhangExtension}
	
OverhangExtension -->
	extrude(overhangLength)

 

Hope that helps.
P

AleksanderAStysiak
New Contributor II

hey! 

Thanks so much for taking the time and looking into this. highly appreciated. 

I tried to get my hands on 2023.1 version before responding but unfortunately, i can only have 2023.0 at this time, so the isTagged functionality does not exist in my version. 

Can you maybe advice on which functionalities can replace isTagged? 

cheers!

0 Kudos
plfontes
Occasional Contributor

No worries, here's an alternative compatible with the 2023.0 version:

 

/*
 * File:    screen_with_overhang.cga
 * Created: 30/04/2024
 * Author:  Patrick Fontes
 
 # This rule assumes you have the wall footprint as the initial shape
 
*/

version "2023.0"

attr screenHeight = 6
attr overhangAngle = 45
attr overhangLength = 1
attr edgeIndex = 0 //this determines the edge from where the overhang hinges 

@StartRule
Screen -->
	extrude(screenHeight)
	comp(f){side: ScreenSides. | top: OverhangHinge}
	
OverhangHinge -->
	roofShed(overhangAngle, edgeIndex)
	comp(f){aslant: OverhangExtension | side : ScreenSides. | top: OverhangExtension}
	
OverhangExtension -->
	extrude(overhangLength)

 


Cheers.

AleksanderAStysiak
New Contributor II

this is amazing! thank you very much for the time and sharing your skills.
I'll take this code and study it now 😉

0 Kudos