+ Reply to Thread
Results 1 to 16 of 16

Thread: Problem With Trimmed Geo and Balconies

  1. #1
    André Cardoso
    Join Date
    Oct 2011
    Posts
    69
    Points
    2
    Answers Provided
    0


    0

    Default Problem With Trimmed Geo and Balconies

    Hi, I have a problem :P


    I'm building balconies, and I'm relying on the trim planes to "join" balconies on different facades:

    Code:
    BalconyStripe -->
        s('3, '1, balconyLength)
        center(x)
        i("builtin:cube:notex")
        BalconySupport

    The problem is that after trimming I get NO endings on the volume, just a hole. Like in the screenshot.

    Can someone help me with this? What's the best approach for these situations?

    Thanks!
    André
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	Screenshot at 2012-03-19 10:47:53.jpg‎
Views:	62
Size:	112.8 KB
ID:	12800   Click image for larger version

Name:	Screenshot at 2012-03-19 10:58:10.jpg‎
Views:	59
Size:	123.1 KB
ID:	12801  
    Last edited by thyandrecardoso; 03-19-2012 at 10:00 AM. Reason: grammar!

  2. #2
    André Cardoso
    Join Date
    Oct 2011
    Posts
    69
    Points
    2
    Answers Provided
    0


    0

    Default Re: Problem With Trimmed Geo and Balconies

    *Bump* :P

    Can anyone help me with this?

  3. #3
    Matthias Buehler

    Join Date
    Oct 2011
    Posts
    1,674
    Points
    438
    Answers Provided
    138


    0

    Default Re: Problem With Trimmed Geo and Balconies

    *normal* [ haha, 3d graphics 'inside joke' ]



    hi ..

    try these files.


    this is a hack though.

    to know : if you cut a profile with a split, the 'closing geometry' is created. thus in this example, we align the scope to some very specific edges to cut from one side, then from the other side to close the geo.

    though since these edges are specific to each assets, they need be found/set manually (play with the values to find them). then, set the miniCutDepth to something small, like 0.005.


    the case why there are no geometries created was just a development decision some time ago. this may change one day.


    use the provided asset, but adapt the path to it ..

    matt

    ps.

    not CGA-related :
    as an architect, I MUST [ ] say that the profile you are using is an ornamental 'band', but is not directly used as a 'form' for a balcony in reality. yes, some details are important .. hehe.
    Attached Files
    _________________

    CityEngine Machinist

    * YOUTUBE CHANNEL : www.youtube.com/channel/UCNS4TLgToEDQiH9pi06ofOA
    * tutorial videos : http://forums.arcgis.com/threads/648...URCES-FAQ-HELP
    * Please use the rating buttons on the right side !

  4. #4
    André Cardoso
    Join Date
    Oct 2011
    Posts
    69
    Points
    2
    Answers Provided
    0


    0

    Default Re: Problem With Trimmed Geo and Balconies

    Quote Originally Posted by matthiasbuehler View Post
    *normal* [ haha, 3d graphics 'inside joke' ]
    Lol


    hi ..

    try these files.


    this is a hack though.

    to know : if you cut a profile with a split, the 'closing geometry' is created. thus in this example, we align the scope to some very specific edges to cut from one side, then from the other side to close the geo.

    though since these edges are specific to each assets, they need be found/set manually (play with the values to find them). then, set the miniCutDepth to something small, like 0.005.


    the case why there are no geometries created was just a development decision some time ago. this may change one day.


    use the provided asset, but adapt the path to it ..

    matt
    Well, first it seems the asset you sent me is with the normals all wrong. So I opted to use the asset I've been using :P This is from the CE examples, and is attached here.

    Second, I could not reproduce the behaviour you explained. No "closing geometries" were created after I splited the geom. Also, I had to change the rules a bit, concerning the split axes, and operation order.

    I even tried some last resort things, like a comp(f)... but see the pictures attached! There you can see the rules and the results.

    It's worth saying that I was inspecting the results both with backface culling on and off...


    ps.

    not CGA-related :
    as an architect, I MUST [ ] say that the profile you are using is an ornamental 'band', but is not directly used as a 'form' for a balcony in reality. yes, some details are important .. hehe.
    That's why on our office we're all computer engineers :P
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	comp1.jpg‎
Views:	32
Size:	116.3 KB
ID:	12965   Click image for larger version

Name:	niled1.jpg‎
Views:	34
Size:	107.9 KB
ID:	12963   Click image for larger version

Name:	colored2.jpg‎
Views:	33
Size:	108.6 KB
ID:	12962   Click image for larger version

Name:	colored1.jpg‎
Views:	37
Size:	123.3 KB
ID:	12961  
    Attached Files

  5. #5
    André Cardoso
    Join Date
    Oct 2011
    Posts
    69
    Points
    2
    Answers Provided
    0


    0

    Default Re: Problem With Trimmed Geo and Balconies

    And this solution is just stupid -- see the screen attached


    :S
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	thing.jpg‎
Views:	28
Size:	113.8 KB
ID:	12966  

  6. #6
    Matthias Buehler

    Join Date
    Oct 2011
    Posts
    1,674
    Points
    438
    Answers Provided
    138


    0

    Default Re: Problem With Trimmed Geo and Balconies

    hi !

    I just retried with this with my original asset : the asset itself works.

    though, there may some other things which go wrong :

    1]
    to make the edge-finding process faster, create an attr of the left and right indices, then use the slider in the Inspector

    when retrying here at home, I weirdly found other indices (left 5 and right 7). puzzling.

    2]
    make sure your scale.sx is large enough to be trimmed even at sharp angles, so maybe scale it to '20 !
    of course, if not all geometry is trimmed, the number of edges is not correct, so the whole point of this hack is lost.

    here's the proof that it works with my code and asset. [sorry, could have posted also before !]
    Click image for larger version

Name:	snippie.PNG
Views:	57
Size:	264.0 KB
ID:	12979


    let me know .. !
    _________________

    CityEngine Machinist

    * YOUTUBE CHANNEL : www.youtube.com/channel/UCNS4TLgToEDQiH9pi06ofOA
    * tutorial videos : http://forums.arcgis.com/threads/648...URCES-FAQ-HELP
    * Please use the rating buttons on the right side !

  7. #7
    André Cardoso
    Join Date
    Oct 2011
    Posts
    69
    Points
    2
    Answers Provided
    0


    0

    Default Re: Problem With Trimmed Geo and Balconies

    Hi!

    Well, it seems you were right about your asset. I tried again and I saw the results. The backface culling must've confused me... sorry!!!

    Concerning the indices, I also found different results weather I was in Linux or Windows ... :S

    HOWEVER, I still did not found a way to solve my problem, with my asset. I think I might just use yours, but I would like to understand this out:
    - using you asset, when choosing incorrect edges the asset was split, but no new faces were created! Why? For example, on the screen I chose edge number 4 and the asset was split from the back. Shouldn't I have gotten a new face there?
    - I went through all the indices on the asset I was using, and could not replicate the behaviour!

    I'm not understanding this very well, because I don't know exactly when new faces are created! Am I missing something?

    Thanks in advance!


    Quote Originally Posted by matthiasbuehler View Post
    hi !

    I just retried with this with my original asset : the asset itself works.

    though, there may some other things which go wrong :

    1]
    to make the edge-finding process faster, create an attr of the left and right indices, then use the slider in the Inspector

    when retrying here at home, I weirdly found other indices (left 5 and right 7). puzzling.

    2]
    make sure your scale.sx is large enough to be trimmed even at sharp angles, so maybe scale it to '20 !
    of course, if not all geometry is trimmed, the number of edges is not correct, so the whole point of this hack is lost.

    here's the proof that it works with my code and asset. [sorry, could have posted also before !]
    Attachment 12979


    let me know .. !
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	nice1.jpg‎
Views:	26
Size:	114.5 KB
ID:	12990   Click image for larger version

Name:	nice-culling.jpg‎
Views:	18
Size:	112.2 KB
ID:	12991   Click image for larger version

Name:	doubt1.jpg‎
Views:	20
Size:	106.8 KB
ID:	12992  

  8. #8
    Matthias Buehler

    Join Date
    Oct 2011
    Posts
    1,674
    Points
    438
    Answers Provided
    138


    0

    Default Re: Problem With Trimmed Geo and Balconies

    hi !

    I've had a look at your asset and it makes sense that it cannot be closed.

    CE can only close 'cylinder - like', CLOSED assets, even if the ends are missing as on my asset. your asset is open on the back side, thus it is not closed as an 'O', but open as a 'C', profile-wise spoken.

    once you have it closed, make sure you merge all the vertices and eges properly to make the tube mathematically 'watertight'.


    ok ?

    I'll track the linux/windows changing indices down !

    matt
    _________________

    CityEngine Machinist

    * YOUTUBE CHANNEL : www.youtube.com/channel/UCNS4TLgToEDQiH9pi06ofOA
    * tutorial videos : http://forums.arcgis.com/threads/648...URCES-FAQ-HELP
    * Please use the rating buttons on the right side !

  9. #9
    Matthias Buehler

    Join Date
    Oct 2011
    Posts
    1,674
    Points
    438
    Answers Provided
    138


    0

    Default Re: Problem With Trimmed Geo and Balconies

    Quote Originally Posted by thyandrecardoso View Post
    - using you asset, when choosing incorrect edges the asset was split, but no new faces were created! Why? For example, on the screen I chose edge number 4 and the asset was split from the back. [COLOR="#FF0000"]Shouldn't I have
    just to be clear, you actually meant using 'my (André's) own' asset, right ?
    _________________

    CityEngine Machinist

    * YOUTUBE CHANNEL : www.youtube.com/channel/UCNS4TLgToEDQiH9pi06ofOA
    * tutorial videos : http://forums.arcgis.com/threads/648...URCES-FAQ-HELP
    * Please use the rating buttons on the right side !

  10. #10
    André Cardoso
    Join Date
    Oct 2011
    Posts
    69
    Points
    2
    Answers Provided
    0


    0

    Default Re: Problem With Trimmed Geo and Balconies

    No!

    Take a look at the screens on that post: the last one ("doubt1.jpg") was taken using YOUR asset.

    Now it makes more sense that my asset doesn't get new faces.
    However, still does not explain why certain split directions don't cause new faces to be created....


    Quote Originally Posted by matthiasbuehler View Post
    just to be clear, you actually meant using 'my (André's) own' asset, right ?

  11. #11
    André Cardoso
    Join Date
    Oct 2011
    Posts
    69
    Points
    2
    Answers Provided
    0


    0

    Default Re: Problem With Trimmed Geo and Balconies

    And thanks for the explanation

    I think I'm going to change my balconies to use your asset :P


    Quote Originally Posted by matthiasbuehler View Post
    hi !

    I've had a look at your asset and it makes sense that it cannot be closed.

    CE can only close 'cylinder - like', CLOSED assets, even if the ends are missing as on my asset. your asset is open on the back side, thus it is not closed as an 'O', but open as a 'C', profile-wise spoken.

    once you have it closed, make sure you merge all the vertices and eges properly to make the tube mathematically 'watertight'.


    ok ?

    I'll track the linux/windows changing indices down !

    matt

  12. #12
    André Cardoso
    Join Date
    Oct 2011
    Posts
    69
    Points
    2
    Answers Provided
    0


    0

    Default Re: Problem With Trimmed Geo and Balconies

    As I told you, I was trying to use your asset "profileAsset.obj" instead of the one I've been using on the balconies. But the asset you gave me comes with normals pointing inside. If you import the asset into CE, and turn on "Backface Culling" you'll see through it!


    Now the interesting part:
    - to overcome this, I made a small change to your previous CGA code:
    Code:
    PutBalcony -->
    	s('20, thickness, depth)
    	center(x)
    	i(profileAsset)
    	reverseNormals
    	LeftTrim(leftEdgeID)
    And now I can't seem to produce the closing geometry anymore. I think I tried all the edge IDs...

    Can you replicate this?

  13. #13
    André Cardoso
    Join Date
    Oct 2011
    Posts
    69
    Points
    2
    Answers Provided
    0


    0

    Default Re: Problem With Trimmed Geo and Balconies

    Of course that, for this specific case -- using your asset, with the normals as they are -- a simple workaround is to leave the "reverseNormals" command to last place:

    Code:
    LeftTrim(n) -->
    	alignScopeToGeometry(yUp, n)
    	alignScopeToAxes(y)
    	split(z) {miniCutDepth : NIL | ~1 : RightTrim(rightEdgeID)}
    
    RightTrim(n) -->
    	alignScopeToGeometry(yUp, n)
    	alignScopeToAxes(y)
    	split(z) {miniCutDepth : NIL | ~1 : reverseNormals X.}

    This way, using the indices 3 and 1 to "split" the geometry continues to work!


    Can you explain me what is going on? I'm a bit confused here...

  14. #14
    Matthias Buehler

    Join Date
    Oct 2011
    Posts
    1,674
    Points
    438
    Answers Provided
    138


    1

    Default Re: Problem With Trimmed Geo and Balconies

    hi !


    indeed, the normals of my asset were inverted. how EVER that happened ..

    Code:
    attr depth = 2
    attr thickness = 0.3
    attr miniCutDepth = 0.5
    
    profileAsset = "assets/profileAsset_normalsOutside.obj"
    
    
    attr leftEdgeID = 0
    attr rightEdgeID = 2
    
    Lot -->
    	extrude(10)
    	split(y){~3 : comp(f) {side :Facade(split.index) | top : Roof.} }*
    
    Facade(i) -->
    	case i != 0 && p(0.6) :
    		Facade.
    		PutBalcony
    	else :
    		Facade.
    
    PutBalcony -->
    	s('20, thickness, depth)
    	center(x)
    	i(profileAsset)
    	LeftTrim(leftEdgeID)
    
    LeftTrim(n) -->
    	print (geometry.nEdges)
    	alignScopeToGeometry(yUp, n)
    	split(z) {~1 : RightTrim(rightEdgeID) | miniCutDepth : NIL}
    
    RightTrim(n) -->
    	alignScopeToGeometry(yUp, n)
    	split(z) { ~1 : X. | miniCutDepth : NIL}
    I adapted the code as seen here and it works again (you can even delete the additional alignScopeToAxes(y) in the Left and RightTrim rules, as done here). Note the 'new' indices which work here. I tested those indices both on Windows and Linux (including backface culling) !

    * * *

    I faced the same issue as you did where it seemed that no index seems to work : that fix was easy.

    since the normals drive the scope alignment (and the normals were inverted), inverting the asset to the 'correct sidedness' inverts the split direction. this means that the split order has to be reversed (note that ~1 : is now first in the split)!

    with the indices 0 and 2 and the new asset, everything works fine.

    * * *

    *phew* .. I'm glad the edge indexing after the trim is consistent on both Linux and Windows !


    more questions ?

    btw. sorry for the confusion with the normals !
    Attached Files
    _________________

    CityEngine Machinist

    * YOUTUBE CHANNEL : www.youtube.com/channel/UCNS4TLgToEDQiH9pi06ofOA
    * tutorial videos : http://forums.arcgis.com/threads/648...URCES-FAQ-HELP
    * Please use the rating buttons on the right side !

  15. #15
    André Cardoso
    Join Date
    Oct 2011
    Posts
    69
    Points
    2
    Answers Provided
    0


    0

    Thumbs up Re: Problem With Trimmed Geo and Balconies

    Now, that's more clearer
    Many thanks for the time spent around this problem, finally understood it

    No, no more questions... for the time being :P

    Thanks!!
    André
    André Cardoso
    Developer(3Decide)
    URL: www.3decide.com

    E-mail: andre.cardoso@3decide.com
    Address: PINC UPTEC – Praça Coronel Pacheco, 2,
    4050-453 Porto, Portugal

    http://about.me/andrecardoso

  16. #16
    Matthias Buehler

    Join Date
    Oct 2011
    Posts
    1,674
    Points
    438
    Answers Provided
    138


    0

    Default Re: Problem With Trimmed Geo and Balconies

    ha !

    it's been a nice session indeed !
    _________________

    CityEngine Machinist

    * YOUTUBE CHANNEL : www.youtube.com/channel/UCNS4TLgToEDQiH9pi06ofOA
    * tutorial videos : http://forums.arcgis.com/threads/648...URCES-FAQ-HELP
    * Please use the rating buttons on the right side !

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts