After we extruded the shape, we split it. comp(f){front:fa}
I want to find the face of fa with the largest area
Hello @biaozeng Thank you for this interesting question!Here are some CGA helper functions that will give you the index of the face with the largest area:
version "2024.1" sizes = comp(f){ all : geometry.area() } indices = sortIndices(sizes) largestIndex = indices[size(indices)-1] @StartRule // Apply on a shape with multiple front faces Generate --> comp(f) { front = comp(f) { largestIndex : color(1,0,1) fa. } }
How are the remaining faces selected
Great answer, I would also like to know if they can be sorted by the position of each face in space, for example by the x-direction of world coordinates, or by the X-axis of scope; For example I want to find the most prominent aspect of the shape in your picture.
You can rewrite the rule to get a sequence of the largest faces like that:
Generate --> comp(f) { front = fa1 } fa1 --> comp(f) { largestIndex : color(1,0,1) fa1. | all = fa2 } fa2 --> comp(f) { largestIndex : color(1,1,0) fa2. | all = fa3 } fa3 --> comp(f) { largestIndex : color(0,1,1) fa3. | all : faRemaining. }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.