# comp(f) roof problem

2688
6
03-05-2014 02:37 AM
New Contributor III
Hi,

I have a gable roof and on one side of the gable I want to create a dormer window.
But when I use the comp(f) tool to select the top of the roof I'm hitting a problem.

When the angle of the roof is less than 45 degrees I cannot specify which side of the top of the roof I want to modify.
comp(f) {top:TopRoof} gives both sides of the top of the roof, when the angle is more than 45 degrees I can use instead of "top" the "front" and "back".

Anyone know a fix for my problem to select the front or back with an angle less than 45 degrees?

cheers,

Brian
Tags (3)
1 Solution

Accepted Solutions
Frequent Contributor II
Hey !

good question.

Look at the CGA Reference and read the comp(f) documentation carefully. You'll notice more selectors.

What I usually do is

comp(f) {bottom : NIL | all : RoofPlane. }

If you need a specific orientation, you can play with

comp(f) {bottom : NIL | world.south : SouthernRoofPlane | all : RoofPlane. } // DID NOT TEST THIS.

otherwise, go via an index attribute to manually choose.

attr roofFaceID = 0

comp(f) { bottom : NIL | all = RoofPlanes } // NOTE THE '=' ! This puts all shapes in 1 new shape, instead of n

RoofPlanes -->
comp(f) {sel ( roofFaceID) : RoofPlaneWithDormer. | all : NoDormers }

Ok ?

matt
6 Replies
Frequent Contributor II
Hey !

good question.

Look at the CGA Reference and read the comp(f) documentation carefully. You'll notice more selectors.

What I usually do is

comp(f) {bottom : NIL | all : RoofPlane. }

If you need a specific orientation, you can play with

comp(f) {bottom : NIL | world.south : SouthernRoofPlane | all : RoofPlane. } // DID NOT TEST THIS.

otherwise, go via an index attribute to manually choose.

attr roofFaceID = 0

comp(f) { bottom : NIL | all = RoofPlanes } // NOTE THE '=' ! This puts all shapes in 1 new shape, instead of n

RoofPlanes -->
comp(f) {sel ( roofFaceID) : RoofPlaneWithDormer. | all : NoDormers }

Ok ?

matt
New Contributor III
thanks it worked!

had to change a small thing:

attr roofFaceID = 0

RoofPlanes -->
comp(f) {sel ( roofFaceID) : RoofPlaneWithDormer. | all : NoDormers }

it expected a string at the roofFaceID part of the code.

changed it to:

RoofPlanes -->
comp(f) {front : RoofPlaneWithDormer. | all : NoDormers }

cheers!
Frequent Contributor II
Glad you got it working !

matt
New Contributor III
One "small thing" I found is that under 15 degrees the rooftops will loose direction tests and begin to test as flat.
I had to add a second test for angle to sort this "bug" out.
Frequent Contributor II
This is not a bug, but the hardcoded angles to which the face selectors work in comp(f). Check the comp() docs for the actual values.

For precise slope and azimuth, use geometry.angle(). Note this is not working in CE 2013 due to a bug. This has been fixed and will be ok in CE2014 that should be released not too far in future.

Matt
New Contributor

HI Brian

could you give me the the rules thats allowed you to generate the dormers ?

ragards