Hello. I'm working on a CGA related to 3D building modeling. Things got a little messy when "Align Shapes to Terrain" got involved. For example, there is a building with 4 floors, each floor is 3 meters. Total height 12 m. When I sit this building on the real terrain model with the Align Shape to Terrain command, I naturally need to use the extrude(world.up.Flattop) command to keep it upright on the surface.When I do this, the height of the 12-meter building changes according to the terrain model.
Now let's get to the main topic. If we just look at the front of the building, for example, the left part of the building, which should have been 12 meters, became 17.2 meters and the right part became 13.2 meters. I have a 4-storey building and the 5th floor cannot be rectangular, since the right corner is 13.2 meters. How can I apply a process so that the top 3 floors are 3 meters and the rest is the ground floor?
Using the comp(fe) function I am able to determine the lengths of the object.right and left values. But since CGA works as a tree system, even if I "set" the values via comp(fe), I cannot re-pass this information on shape. I am attaching the sample code and the image I want to make below. I will be grateful if you could help me.
@Hidden
attr LeftHeight = 0
@Hidden
attr RightHeight = 0
BuildingFront-->
alignScopeToAxes(world.y)
comp(fe) { object.left : LeftSide | object.right : RightSide | all : NIL}
BuildingFrontNew
LeftSide-->
set(LeftHeight,scope.sx)
report("LeftHeight",LeftHeight)
RightSide-->
set(RightHeight,scope.sx)
report("RightHeight",RightHeight)
With this example code, I cannot continue over BuildingFrontNew because the values I set still appear as zero on BuildingFrontNew.