16 Replies Latest reply on Mar 26, 2012 7:05 AM by thyandrecardoso

    Problem With Trimmed Geo and Balconies

    thyandrecardoso
      Hi, I have a problem :P


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


      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é
        • Re: Problem With Trimmed Geo and Balconies
          thyandrecardoso
          *Bump* :P

          Can anyone help me with this?
          • Re: Problem With Trimmed Geo and Balconies
            geonetadmin
            Original User: matthiasbuehler

            *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.
            • Re: Problem With Trimmed Geo and Balconies
              thyandrecardoso

              *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
              • Re: Problem With Trimmed Geo and Balconies
                thyandrecardoso
                And this solution is just stupid -- see the screen attached


                :S
                • Re: Problem With Trimmed Geo and Balconies
                  geonetadmin
                  Original User: matthiasbuehler

                  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 !]
                  [ATTACH=CONFIG]12979[/ATTACH]


                  let me know .. !
                  • Re: Problem With Trimmed Geo and Balconies
                    thyandrecardoso
                    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!


                    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 !] 
                    [ATTACH=CONFIG]12979[/ATTACH] 


                    let me know .. !
                    • Re: Problem With Trimmed Geo and Balconies
                      geonetadmin
                      Original User: matthiasbuehler

                      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
                      • Re: Problem With Trimmed Geo and Balconies
                        MBuehler-esristaff

                        - 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 ?
                        • Re: Problem With Trimmed Geo and Balconies
                          geonetadmin
                          Original User: thyandrecardoso

                          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....


                          just to be clear, you actually meant using 'my (André's) own' asset, right ?
                          • Re: Problem With Trimmed Geo and Balconies
                            thyandrecardoso
                            And thanks for the explanation :)

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


                            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
                            • Re: Problem With Trimmed Geo and Balconies
                              geonetadmin
                              Original User: thyandrecardoso

                              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:
                              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?
                              • Re: Problem With Trimmed Geo and Balconies
                                thyandrecardoso
                                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:


                                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...
                                • Re: Problem With Trimmed Geo and Balconies
                                  geonetadmin
                                  Original User: matthiasbuehler

                                  hi !


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

                                  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 !
                                  • Re: Problem With Trimmed Geo and Balconies
                                    thyandrecardoso
                                    Now, that's more clearer :D
                                    Many thanks for the time spent around this problem, finally understood it :)

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

                                    Thanks!!
                                    André
                                    • Re: Problem With Trimmed Geo and Balconies
                                      geonetadmin
                                      Original User: matthiasbuehler

                                      ha !

                                      it's been a nice session indeed ! :o