ansys / ansys/pyprimemesh

Expose TopoEntity coordinates and add query methods to TopoEntities

Open
#880 0 comments 0 reactions 0 assignees View on GitHub
aps enhancement
Dominant language
Python
Stars
35
Forks
14
Avg merge
3d 5h
Merged PRs (30d)
11

Description

### 📝 Description of the feature

Our models contain a lot of trimmed surfaces and breps that later need to be meshed with scaffold surface meshing. If I use CAD imports that do not provide all the necessary entitity names, I need to query the entities and give names within pyprime. I want to create zones and labels inside pyprime and be able to control the meshing through sizing in more detail. The labels are needed to be able to pass them on to PyACP.

I did not find such query methods and access to the underlying data structures of topo_entities. Access to only connectivities will not help, if I have to test point coordinates, etc. Therefore, I create this feature request.

This is a list of query methods and attributes that would be useful to identify the entitities:

**TopoNode:** TopoEntity representing points
o Properties
- location (position coordinates) of this point

o Methods
- geometry_equals: Determines if two geometries equal one another by a certain tolerance that can be provided
- distance_to: Evaluate the distance to the provided point coordinates
- get_labels: return list of labels that this node is grouped to, None if not grouped in any label

**TopoEdge:** TopoEntity representing curves
o Properties
- point_at_start: either return TopoNode or point coordinates of TopoNode directly
- point_at_endt: either return TopoNode or point coordinates of TopoNode directly

o Methods
- closest_point(test_point, maximum_distance): find point on edge that is closest to test_point. maximum_distance might be an option to substantially speed up the search. Return closest point and if possible euclidean, lateral and normal distance
- get_zones: return list of zones that this edge is grouped to, None if not grouped in any zone
- get_labels: return list of labels that this edge is grouped to, None if not grouped in any label
- geometry_equals: Determines if two geometries equal one another by a certain tolerance that can be provided
- point_at_normalized_length: gets a point at a certain normalized length along the edge. The length must be between or including 0.0 and 1.0, where 0.0 equals the start of the edge and 1.0 the end of the edge

**TopoFace:** TopoEntity representing surfaces
o Properties
- topo_edges

o Methods
- closest_point(test_point, maximum_distance): find point on face that is closest to test_point. maximum_distance might be an option to substantially speed up the search. Return closest point and if possible euclidean, lateral and normal distance
- topo_edge_equals_face_edge: Determines if a provided topo_edge lies on the edge of the face within a certian tolerance.
- get_zones: return list of zones that this face is grouped to, None if not grouped in any zone
- get_labels: return list of labels that this face is grouped to, None if not grouped in any label

**Zones:**
o Properties
- topo_faces

o Methods
- create_zone_from_topo_faces

**Labels:**
o Properties
- topo_nodes
- topo_edges
- topo_faces

o Methods
- create_label_from_topo_faces
- create_label_from_topo_nodes
- create_label_from_topo_edges
- create_label_from_labels

### 💡 Steps for implementing the feature

_No response_

### 🔗 Useful links and references

_No response_

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by locating the TopoEntity, TopoNode, TopoEdge, TopoFace, Zones, and Labels implementations, then determine how their coordinates, connectivity, grouping, and query APIs are exposed; done means the agreed subset of requested properties and methods is implemented and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.