Please or 注册 to create posts and topics.

找到最大区域的面

找到最大区域的脸

挤出形状后,我们将其拆分。 comp(f){front:fa}

我想找到最大区域的FA的脸

 

谢谢您的这个有趣的问题!以下是一些CGA辅助功能,可以为您提供最大区域的脸部
索引:

 

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

 

最大frontface.gif

在原始帖子中查看解决方案

谢谢您的这个有趣的问题!以下是一些CGA辅助功能,可以为您提供最大区域的脸部
索引:

 

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

 

最大frontface.gif

 

您可以重写规则以获取这样的最大面孔的顺序:

 

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

 

thomasfuchs_0-1740129469465.png