split an uneven polygon

Jump to solution
07-15-2019 05:27 AM
New Contributor III

Hello there,

I would like to construct a wall (see "Schanze") on an uneven polygon. Therefore I want to split the polygon into five sections. However, I don't get continuous parts parallel to the polygon lines. Instead it is divided strangely (see "SplitArea").

Does anyone know how to do this correctly (see "SplitAreaSketch")? Does it work with the "splitArea" operator? or are there other useful operators for it?

Matthias BuehlerCheryl LauGeoff TaylorElliot HartleyDavid WassermanChris Wilkins Thomas Fuchs L R Michelle Mathias

0 Kudos
1 Solution

Accepted Solutions
New Contributor III


I have now split the street as suggested by you with split uv and created three rules for the three street segments. The flattened ends i have constructed with Autodesk 3 DS Max, imported to cityengine and linked to the ends of the street.

Thank you all for the great advice, you helped me a lot.

View solution in original post

10 Replies
by Anonymous User
Not applicable


From your first image, my first thought is that you should be using split operation in place of splitArea.

From second image I would recommend alignScopeToGeometry for aligning to the rectangle.

But from the third image I see the polygon is not a rectangle. If you want to have this shape running along a curved path there is a somewhat new operation called insertAlongUV. I believe that is your way to go.


New Contributor III

Hi, Chris,

thank you for your suggestion. I didn't know this operator yet, but it says on the help page that it inserts 3D models and assets.

However, I created the wall (see "Schanze") as a rule file and would like to assign this file to the curvy path. This doesn't work at the moment (see "Schanze_assigned", picture below).


And with the split-operator i don't get vertical splits (parallel to the long side) either.

Does the "insertAlongUV"-operator also work to insert rule files?

0 Kudos
Regular Contributor

Chris Wilkins‌ beat me to it with his time zone related superpowers. 
I agree with Chris that a UV approach is more likely to work for this. My concern is whether we can get it properly align with the current polygon shape (we likely could for most of it). I think I have a few pre-processing suggestions that might make a rule to do this simpler. 
1. Break up the polygons based on their nearest vertex joints- if you split it so that each shape is "roughly" rectangular, it would be easier to get an alignment between shapes. This might be difficult. 
2. Represent the polygon as a street - A street can accommodate the curves desired more appropriately, but requires representing the polygon as a polyline for import. 
I am sure there is a pure CGA around this, but it might require some smart calibration of the UV space and subsplits to provide exactly what you are looking for. 

David Wasserman, AICP
New Contributor III


i have now converted the polygon into a polyline (see "Polylinie_Schanze") and assigned the rules file (schanze.cga) to this street (see "Polylinie_Regel").



As you can see, the rule is not assigned correctly.

Can i split the street vertically? Or should i leave the rule file that way and try to insert it with insertAlongUV?

Can i also split a polyline into rectangles, as you suggested?

Thank you for your suggestions. 

0 Kudos
Regular Contributor

I generally just prepare the data beforehand before trying to hamfist CE into doing complex things. Just split the base shape manually. If you don't want to, try playing around with the setback operation. Or try a graph, here's something to start with:

attr shapeType = ""

 Lot --> 
     case shapeType == "Sidewalk": Tri
     case shapeType == "Street": Cent
     else: NIL
Tri --> 
roofShed(byHeight, 5,2)

Cent --> color(1,1,0)

The height will probably muck up if the graph is too curvy, I avoid using CE for streets.

0 Kudos
New Contributor III


Thank you for your suggestion, Raze. I just used the street segments to build the wall with split and envelope (see "Schanze1").


But now I have the problem that when aligning the wallto the terrain, the wall is cut up and the fence is not completely mapped. In addition, the road is partially covered by the terrain, whereby I already have an offset of 0.5 in it (see "Schanze_Terrain").


Does any of you know why this is so and how to fix it?

Regular Contributor

I think I do...Something to remember about street shapes is that they dynamically segment themselves technical when exposed to curves. As a result, it is typically recommended to stick to UV based operations (insertAlongUV changed much of what was possible in the Complete_Street.cga rule for this reason). However, images help tell this story. I applied the TOD.cga rule in the Land_Use folder of the Complete Street repo linked above to three different streets, each manipulated differently. Notice how, the curved non-straight street broke multiple times based on the shapes articulations. Instead of one building, I have dozens. You can see how the complete street rule by comparison is depending on inserted shapes/models, simple extrusions, and textures. 

Based on this you have a few options: 

1. Keep the street shapes as straight as possible. Remove all curves from the geometry. 

2. Use insertAlongUV with predesigned shapes/3D models. It is possible the envelop operation is not what we want here. 

3. Something else. There are likely other ways to set up the shape. It might work now, but previously the comp operation (= vs. : - see the operator), did not work on street shapes to consolidate this segmentation behavior into one shape. It does create headaches. For example, if you can insert a thin base using the insertAlongUV operations, then component split the top of that shape with a = operator...it might keep it in one shape. However, in my experience, the envelope operation is very sensitive to starting geometry (I still don't have raised crosswalks for this reason.) .

Street rules are like programming on shifting sand. 

David Wasserman, AICP
Esri Regular Contributor

I would recommend starting with street shapes since they have UVs that curve with the street as it curves to the left and right and goes up and down hills.

If you want to design your own rules, you could use operations like split in uv space (i.e. split in v to split along the street; split in u splits across the street) and insertAlongUV to maintain the curved nature of the streets.  Make your own asset to use with insertAlongUV by exporting your own creation to obj.  Using alignScopeToAxes(y) before inserting the object would make sure the asset is extruded upwards, which would mean that you could avoid those disconnecting cuts you get between the hilly segments.  This would also mean the hilly segments would get sheared assets, but maybe this is ok for you.

split operation—CGA | ArcGIS 

insertAlongUV operation—CGA | ArcGIS 

Alternatively, you could apply the rule ESRI.lib/rules/Fences/Fence_On_Graph.cga to your street shape.  The tapered base asset in ESRI.lib/assets/Fences/Objects/taperedBase.obj looks similar to your first image.  Try setting the style to Jersey_Barrier and then changing the attr baseMiddle_asset to the tapered base asset.  You could also make your own assets to use in this rule.  Here's what the fence styles look like:

Regular Contributor

These are great examples! Thanks!

David Wasserman, AICP
0 Kudos