Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structure_Engine: Update to area loads visualisation #1966

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Structure_Engine/Query/PointGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,36 @@ public static List<Point> PointGrid(this Panel panel)
return pts;
}

/***************************************************/

[Description("Generates a rectangular grid of points on the each face of the FEMesh. Used for load visualisation.")]
[Input("mesh", "The FEMesh to generate a grid on.")]
[Output("grid", "Rectangular grid of points on the FEMesh.")]
public static List<List<Point>> PointGrid(this FEMesh mesh)
{
return mesh.Faces.Select(x => x.PointGrid(mesh)).ToList();
}

[Description("Generates a rectangular grid of points on the FEMeshFace of the FEMesh. Used for load visualisation.")]
[Input("face", "The FEMeshFace to generate a grid on.")]
[Input("mesh", "The FEMesh to which the face belongs.")]
[Output("grid", "Rectangular grid of points on the FEMeshFace.")]
public static List<Point> PointGrid(this FEMeshFace face, FEMesh mesh)
IsakNaslundBh marked this conversation as resolved.
Show resolved Hide resolved
{
List<Point> pts = face.NodeListIndices.Select(i => mesh.Nodes[i].Position).ToList();

List<Point> temp = new List<Point>();

for (int i = 0; i < pts.Count; i++)
{
int next = (i + 1) % pts.Count;
temp.Add((pts[i] + pts[next]) / 2);
}
pts.AddRange(temp);
pts.Add(pts.Average());
return pts;
}

/***************************************************/
/**** Public Methods Interface ****/
/***************************************************/
Expand Down
Loading