Primitives - unexpected / inconsistent results

617
3
Jump to solution
07-28-2016 07:55 AM
BenLeslie1
Regular Contributor

I am attempting to randomly position boxes on the roofs of buildings using scatter() and primitiveCube().

1.  I am experiencing what appears to be inconsistent behaviour whereby some cubes are missing faces, or have their geometry clipped if they extend beyond the geometry of the face they are scattered upon - other ones are fine.  The image below shows this behaviour using primitiveSphere because it's easier to see the problem with spheres - the blue face is the face they being scattered on.

Primitives.jpg

2. Is there a way to prevent items that are being scattered from overhanging? - I am trying to do this using the offset() funtion to reduce the size of the scatter-face but this has the effect of making the object tend towards being positioned in the centre, which I don't necessarily want.

0 Kudos
1 Solution

Accepted Solutions
CherylLau
Esri Regular Contributor

I wasn't able to reproduce the cut primitives as they look in your image.  However, I have a feeling that the primitives are being cut by trim planes though.  You can turn the trim planes off, and maybe this will prevent the primitives from being cut:

set(trim.vertical, false)

As for preventing overhanging cubes, if you offset by -0.5*width and use a uniform scatter, this should give you a uniform placement without cubes that hang off the roof.  I'm not sure what you mean when you say using the offset makes your objects centered on the roof.  Yes, they make the objects more centered, but if they weren't more centered, they'd be overhanging.

Lot -->

      offset(-0.5*width, inside)

      scatter(surface, 10, uniform) { Point }

Point -->

      primitiveCube(width, width, width)

View solution in original post

0 Kudos
3 Replies
CherylLau
Esri Regular Contributor

I wasn't able to reproduce the cut primitives as they look in your image.  However, I have a feeling that the primitives are being cut by trim planes though.  You can turn the trim planes off, and maybe this will prevent the primitives from being cut:

set(trim.vertical, false)

As for preventing overhanging cubes, if you offset by -0.5*width and use a uniform scatter, this should give you a uniform placement without cubes that hang off the roof.  I'm not sure what you mean when you say using the offset makes your objects centered on the roof.  Yes, they make the objects more centered, but if they weren't more centered, they'd be overhanging.

Lot -->

      offset(-0.5*width, inside)

      scatter(surface, 10, uniform) { Point }

Point -->

      primitiveCube(width, width, width)

0 Kudos
BenLeslie1
Regular Contributor

Well, funnily enough, I just re-opened CE and am no longer experiencing the cut geometry - it fixed itself, but thanks anyway, I'll think of bears to remind me of your tip.

But if I "set(trim.vertical, true)" I still get inconsistent results as shown in the image, some are not cut.....

And yeah, I realised later that my second question was a bit self defeating.....

Cheers.

0 Kudos
CherylLau
Esri Regular Contributor

Yes, there might be a slight bug with the classification of horizontal and vertical trim planes on the top and bottom faces after a comp.  We are investigating it.  If you want all the trim planes, set the horizontal ones to true as well.

0 Kudos