Scopes and Orientations - Put a Fence all around

3979
7
01-11-2012 03:04 AM
AndréCardoso
New Contributor III
I reckon I should know how to do this correctly by now...but no lol

Well, I want to put a fence all around a shape (specifically, a square or rectangle), with no particular "orientation" set (= don't know street side, or first edge, or whatever...).
Also, the shape might not be horizontal (might be aligned to some terrain).

The fence I want to put is the one in the attachments (which is not yUp, I think). The fence has a "interior" and "outer" side -- a side which should be oriented to the interior of the shape, and a side which should be oriented to the outside of the shape.

I'm trying to do this with "setbacks", and then normal "splits", with some "alignScopeToGeometry" on the way...
My problem is that I can't ORIENT the fence correctly on all the sides (because, after the setback the scope is not always oriented the same way).
More specifically, I've been able to put the fence all around the shape, with the right side upwards; However, on some sides of the shape, I'm not able to correctly orient the interior and outer side of the fence.

I think this is a fairly simple thing to the CGA "gurus" :P, can you post a solution here?

Thanks in advance!!
André
0 Kudos
7 Replies
MatthiasBuehler1
Frequent Contributor
hi !

first question :

are you sure you want to use this fence asset and not just it's 3 main components (post, bar, fenceboard) ? I guess tiling this object produces strange scaling.



lemme know. :cool:

matt
0 Kudos
MatthiasBuehler1
Frequent Contributor
an other advantage of creating single fence pieces is that you can adapt to slopes..

I made a quick example .. not perfect, but it shows a few things.
[ATTACH=CONFIG]11128[/ATTACH]

fence assets & CGA code, see attached zip
AndréCardoso
New Contributor III
an other advantage of creating single fence pieces is that you can adapt to slopes..

I made a quick example .. not perfect, but it shows a few things.
[ATTACH=CONFIG]11128[/ATTACH]

fence assets & CGA code, see attached zip


Damn, I was doing a nice drawing lol.

But I think I will post the whole thing anyway:

I don't really know what you mean by strange scalling... but let me alter a little the question:
- I want to position a fence asset which is not longitudinally symmetric (I think this is how one should phrase this ... lol).

My problem, it seems, is that when doing the setback, and selecting the borders with "comp(f)", the scopes of the borders are not "symmetric".
My nice drawing (looking from above) on the attachments explains what I mean 🙂

Is there anyway to make the scopes "symmetric" after the setback ?

I will look closer on you CGA now.
Thanks a lot!
André
0 Kudos
MatthiasBuehler1
Frequent Contributor
hi !

well, synchronizing can no more be forced after you separate shapes e.g. with a split or comp(f). once the Model Hierarchy is branched, the shapes can not communicate or get directly synched.

thus, in your specific case it's easiest to use the extrude() operation's nature to point all faces' normals to the 'outside' (note that the input face's normal is also reversed after the extrude op) to make sure all fences are correctly placed.

* * *

once you've gone over the CGA rule, you may have a few questions, but I guess you get the main ideas.

1] the point of the strange scaling is that if you model this fence asset to be 4 meters wide and you just insert this, there may be cases where fences are only 0.5 meters wide, thus scaling the asset quite extremely. this must be avoided. thus, I'd recommend to create the fence itself completely procedural.

2] the second point is that usually the pointy fence boards are placed exactly vertically. if you insert a 4-meter prebuilt asset on a sloped fence, all the boards of course point up not vertically since it's just a 'dumb' asset which is placed tilted.

3] at one point in the CGA code, you find a strange roof() operation. this is hack since we have no bevel op yet to basically build a little roof on the board edges and directly cutting off the most of the 'tip', leaving the beveled geometry.
0 Kudos
AndréCardoso
New Contributor III
hi !

well, synchronizing can no more be forced after you separate shapes e.g. with a split or comp(f). once the Model Hierarchy is branched, the shapes can not communicate or get directly synched.

thus, in your specific case it's easiest to use the extrude() operation's nature to point all faces' normals to the 'outside' (note that the input face's normal is also reversed after the extrude op) to make sure all fences are correctly placed.

* * *

once you've gone over the CGA rule, you may have a few questions, but I guess you get the main ideas.

1] the point of the strange scaling is that if you model this fence asset to be 4 meters wide and you just insert this, there may be cases where fences are only 0.5 meters wide, thus scaling the asset quite extremely. this must be avoided. thus, I'd recommend to create the fence itself completely procedural.

2] the second point is that usually the pointy fence boards are placed exactly vertically. if you insert a 4-meter prebuilt asset on a sloped fence, all the boards of course point up not vertically since it's just a 'dumb' asset which is placed tilted.

3] at one point in the CGA code, you find a strange roof() operation. this is hack since we have no bevel op yet to basically build a little roof on the board edges and directly cutting off the most of the 'tip', leaving the beveled geometry.



Yup, the extrude, and comp after that, does the trick. It's a shame I did not think of that 😞 ...

All the points made about the scaling are quite valid... now I understand the scaling thing.

One last thing, just for the record, about "the shapes can not communicate or get directly synched":
- it would be awesome if this was possible. If, at least, "leaves" of the hierarchy could some how query each other, it would be a powerful tool.
(I have a friend doing his PhD right now on procedural modelling, directed to games... on conversations about the matter, we agree that this would be a quite interesting and useful feature)


Thanks a lot for the help... on to to build awesome fences now 😄
André
0 Kudos
MatthiasBuehler1
Frequent Contributor
it would be awesome, but it's currently just not possible to do such queries.

I've wished for this already many times too.
0 Kudos
BenjaminSmith_McRobie1
New Contributor II

Hello all!

I stumbled upon this rule and I love it! I was curious how you would go about editing the rule or the parameters to not generate a greenspace on the polygon. I'm looking to add this to a polygon that contains a parking lot rule from the Complete Streets rule package.