Cannot make generated cube avoid existing shape

162
3
Jump to solution
11-07-2022 11:10 AM
DianaC
by
New Contributor II

I am a beginner using City Engine 2022.0. I am trying to write a rule that would create a mass in blocks between existing buildings. I am applying my rule for a block, created inside of the road network (no subdivision, shape creation enabled). Existing buildings are imported from Arcgis Pro as shapes (they are extruded by attribute) and left on different layer. I uploaded a screenshot where white buildings are existing ones, extruded from shapes, and red ones are newly generated.

The problem is that I cannot find how to make new (red) shapes avoid existing shapes (white). Is there some kind of a rule that would allow me to do it? Or maybe it is possible to subdivide the block into smaller shapes and exclude ones that are overlapped by shapes? Thought about using occlusion queries (inside, overlaps, touches) for that, but failed to make it work. Is it even possible to do something like that?

0 Kudos
1 Solution

Accepted Solutions
plfontes
New Contributor III

Hi DianaC,

Try not use labels with your Occlusion query and see if it works or try minimumDistance.

PortaloErdve -->
  case minimumDistance(all,"{your existing shapes label}") < 1 : NIL
  else: scatter(surface, 100, uniform){ PortaloTuris }

 

Hope this help.

View solution in original post

3 Replies
plfontes
New Contributor III

Hi DianaC,

Try not use labels with your Occlusion query and see if it works or try minimumDistance.

PortaloErdve -->
  case minimumDistance(all,"{your existing shapes label}") < 1 : NIL
  else: scatter(surface, 100, uniform){ PortaloTuris }

 

Hope this help.

DianaC
by
New Contributor II

Hello plfontes,

Thank you for your advice, it was exactly what I was looking for.

CherylLau
Esri Regular Contributor

Yes, it is possible to do this with occlusion queries.  After creating your red buildings in PortaloTuris, check to see if they overlap with anything else.

PortaloTuris -->
	primitiveCube
	s(10,5,5)
	color("#ff0000")
	CheckPortaloTuris
	
CheckPortaloTuris -->
	case overlaps():
		NIL
	else:
		KeepBuilding

 

It's also possible to use labels.  For example, if you want to only check if they occlude with the white buildings (and it doesn't matter if they occlude with other red buildings), then use a label in the occlusion query, and put a rule onto the white buildings which assigns the label.

const occluderLabel = "WhiteBuilding"

CheckPortaloTuris -->
	case overlaps(inter, occluderLabel):
		NIL
	else:
		KeepBuilding

// assign this rule to the white buildings
WhiteBuilding -->
	label(occluderLabel)

 

0 Kudos