How to get Edges and Faces from Step File - c#

Hello I am using DEVDEPT 3D engine FEM VERSION. I can read the Step File with ReadSTEP comand.
I would like to get the value of the Vertices, Edges and Faces.
I can read "design1.Entities[0].Vertices[0].X" from my c#code,
But I can not read "design1.Entities[0].Edges[0]" or "design1.Entities[0].Faces[0]".
There is no edges and faces properties on entities as I see.
how can i get faces and edges values?
Regards
Ahmet.
unfortunately I don’t know where is the problem?

Related

Looking for an Algorithm for getting Polygons in List of open Pathes(Lists of Vector2d )

i´m wondering if there is an algorithm to all get the closed Polygons in a set of Pathes, like in the Image. I know there is the Intersection algorithm and als intesection of two closed Polygons, but I have just these vector of lines as an input. I´m working in C# and Unity. But of course this is a general question.
Thanks ahead
How about something like this:
Intersect each polyline with all others.
Split each polyline at the intersection points. Creating separate segments between each intersection point.
Put each segment in a structure representing a graph, with a node at each intersection, and edges to describe how nodes are connected.
Start any arbitrary segment
Traverse the graph, selecting the first clockwise edge at each node.
When the starting edge is reached, Output the traversed polygon
Mark each traversed edge.
Repeat from step 5, selecting the next un-marked edge.
There are multiple ways to describe a graph in this way. I would suggest using half-edge structure, where each edge is stored two times, in opposite directions. So the nodes would have a list of outgoing edges, and each edge would have a single target node. This makes it easier to mark traversed edges since you do not need to keep track of the direction you are traveling in.

How to get NavMesh polygons in Unity 3d

Question is simple, but i can't find answer on the land of internet. How to get all polys of navmesh, how to find closest ones, how to find centers of these polys, how to find polys connected to specific one, and so on?
Does unity even allow this kind of staff or you need again to download something from github or buy some on asset store?
I find this post https://forum.unity.com/threads/accessing-navmesh-vertices.130883/
but it help find only vertices, not polygons or something..
So, does anyone know anything about this?
The solution:
var navMesh = NavMesh.CalculateTriangulation();
Vector3[] vertices = navMesh.vertices;
int[] polygons = navMesh.indices;
Source: https://docs.unity3d.com/ScriptReference/AI.NavMeshTriangulation-indices.html
Triangle indices for the navmesh triangulation.
Contains 3 integers for each triangle. These integers refer to the vertices array.
Should be the points in each polygon if I'm not mistaken.
Other useful methods:
https://docs.unity3d.com/540/Documentation/ScriptReference/NavMesh.SamplePosition.html
From this source: "Finds the closest point on NavMesh within specified range."
https://docs.unity3d.com/530/Documentation/ScriptReference/NavMesh.Raycast.html
"Trace a line between two points on the NavMesh.
bool True if the ray is terminated before reaching target position. Otherwise returns false. "
https://docs.unity3d.com/530/Documentation/ScriptReference/NavMesh.FindClosestEdge.html
"Locate the closest NavMesh edge from a point on the NavMesh."
What exactly are you needing the navmesh data for?

Normals per face in OpenTK/GL

I was wondering how to set a normal array for faces instead for vertices with NormalPointer. I use DrawElements for drawing quads but edge vertices are always shared with multiple quads so the definition of normals per vertex is not helpful. When I duplicate vertices and use no ElementArrayBuffer I can solve this by using DrawArrays. However, the duplication of the vertices and using DrawArrays results in inaccaptable artefacts between the quads. Is there any possibility to use a list of face normals together with ElementArrayBuffer? Can this only be done with shaders?
Thanks in advance!

Is it possible to extract angles from the skeletal tracking for all the joints?

is it possible to extract the angles of the skeleton ?
If it is possible anybody has sample code to guide me through?
This is more of a mathematical problem. You may have better luck with this question at math.stackexchange.com, but you need to ask it properly.
The kinect-sdk gives joint locations in 3D space, so you just need the angle between 3 points in 3D space. The position of the head joint using the kinect-sdk, for example, is found like this:
Skeleton skeleton;
...
var head = skeleton.Joints[JointType.Head].Position;
See Skeletal Tracking and JointType.

How to getting dimensions from STL file?

I have an binary format STL (STereoLithography) file, I have successfully read the file from c#.net and got the facets, I also got the count of triangles, volume of the part and surface area of the part. But now the problem is that I am not able to find the dimensions of the 3D object(Length,breadth,height). Please help.
I think you will probably have to calculate this yourself, but the algorithm should be fairly simple, assuming you want the dimensions in x,y,z rather than some rotation. Loop through the facets to find the max and min x,y and z coordinate values. Then the dimensions are simply the differences between max and min.
Edit: you could keep track of the max/min values while reading in the points from the file for a minor performance boost.

Categories

Resources