-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnalyzeFaceCompactness.cs
52 lines (49 loc) · 1.65 KB
/
AnalyzeFaceCompactness.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using Mola;
using Grasshopper;
using Grasshopper.Kernel;
using Rhino.Geometry;
namespace HDMolaGH
{
public class AnalyzeFaceCompactness : GH_Component
{
public AnalyzeFaceCompactness()
: base("Analyze Face Compactness", "Face Compactness",
"get a list of face compactness",
"Mola", "3-Analysis")
{
}
public override GH_Exposure Exposure => GH_Exposure.primary;
protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)
{
pManager.AddGenericParameter("MolaMesh", "M", "mesh to be analyzed", GH_ParamAccess.item);
}
protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
{
pManager.AddNumberParameter("FaceCompactness", "C", "a list of face compactness", GH_ParamAccess.list);
}
protected override void SolveInstance(IGH_DataAccess DA)
{
MolaMesh mMesh = new MolaMesh();
DA.GetData(0, ref mMesh);
List<float> compactnessList = new List<float>();
for (int i = 0; i < mMesh.FacesCount(); i++)
{
compactnessList.Add(mMesh.FaceCompactness(i));
}
DA.SetDataList(0, compactnessList);
}
protected override System.Drawing.Bitmap Icon
{
get
{
return Properties.Resources.compactness;
}
}
public override Guid ComponentGuid
{
get { return new Guid("5a4d20e3-239b-44a5-a3db-62fdcd01f910"); }
}
}
}