Model.hm_getsurfacecurvatureforedges#
- Model.hm_getsurfacecurvatureforedges(curv_method='by_chord', collection=Collection(), min_edgepts_span=-1.000000, offset='autodefined', offset_method='in_surface', straight_edge_max_pts=0)#
Returns information about the curvature of surfaces attached to edges.
- Parameters:
curv_method (hwString) –
A string specifying the approximate calculation of the adjacent surface curvature using offset. Valid strings are:
by_chord (default) - The circle radius is evaluated by the edge test point, offset point and angle between the surface normal at the test point and the chordal segment defined by the test and offset points.
by_3pts - The circle radius is evaluated by the edge test point, offset point and middle surface point.
by_normal - The circle radius is evaluated by the angle between the surface normals at the edge test point and offset point and offset arc distance.
collection (Collection) – The collection containing the surface edges (line entities). If empty collection is provided, all edges are considered.
min_edgepts_span (double) – A positive number specifying the minimal distance between the edge test points where the break information is evaluated. If not specified, it is auto defined. A smaller value allows for more detailed information for an edge.
offset (hwString) – The value of offset across an edge inward to the adjacent surfaces, used for evaluation of curvature of the surfaces. The offset is applied at several test points along the edge. Valid values are a positive real number in string format, autodefined, global_element_size.
offset_method (hwString) –
A string specifying the how the offset inward from adjacent surfaces is performed. Valid strings are:
in_surface (default) - The offset is limited by the surface opposite edge. It stops on the opposite surface edge if it is reached at a distance smaller than the specified offset value. Suppressed edges are disregarded and offset is performed over those edges.
in_face - The offset is limited by the face opposite edge. It stops on the opposite face edge if it is reached at a distance smaller than the specified offset value. Suppressed edges are considered.
in_face_monot - Same as in_face but the offset is also limited by the distance from the edge test point where the curvature changes monotonically. If the face has an inflection point, the offset stops at this point.
no_offset - The offset is not performed at all and the local surface curvature is found analytically in a surface point adjacent to the edge test point.
over_surface - The offset is not limited by the adjacent surface boundary. It is performed until the specified offset value is reached and stops only on non-manifold edges.
straight_edge_max_pts (int) – The maximum number of test points for straight edges. If not specified a value of 10 is used. If 0, the number of test points for straight edges is not limited.
- Returns:
hwReturnStatus- Status objectHmQueryResultList- Result list object containingHmQueryResultobjects with the following output data:edge (Entity) - Entity Type:
Linesurface1_id (int)
surface1CurvatureMax (double)
surface1CurvatureMin (double)
surface1CurvatureAvg (double)
surface2_id (int)
surface2CurvatureMax (double)
surface2CurvatureMin (double)
surface2CurvatureAvg (double)
surface1CurvatureAtMaxBreakPoint (double)
surface2CurvatureAtMaxBreakPoint (double)
surface1CurvatureAtMinBreakPoint (double)
surface2CurvatureAtMinBreakPoint (double)
breakAngleMax (double)
breakAngleMin (double)
breakAngleAvg (double)
Note
The output values with the suffix maxBreakPoint and minBreakPoint refer to the edge points with corresponding max and min curvature breaks. Only shared and suppressed edges are considered, results are not returned for free and non-manifold edges. For suppressed edges, the adjacent face are output for surface1_id and surface2_id. These entities are presented as negative numbers to allow for easy identification.
Results for break angle are presented in degrees.
Example#
Return the curvature for surfaces attached to all edges#import hm import hm.entities as ent model = hm.Model() _, resultlist = model.hm_getsurfacecurvatureforedges() for result in resultlist: print("Edge:", result.edge.id) print("Surface 1:", result.surface1_id) print("Surface 1 Curvature Max:", result.surface1CurvatureMax) print("Surface 1 Curvature Min:", result.surface1CurvatureMin) print("Surface 1 Curvature Average:", result.surface1CurvatureAvg) print("Surface 2:", result.surface2_id) print("Surface 2 Curvature Max:", result.surface2CurvatureMax) print("Surface 2 Curvature Min:", result.surface2CurvatureMin) print("Surface 2 Curvature Average:", result.surface2CurvatureAvg) print( "Surface 1 Curvature At Max Break Point:", result.surface1CurvatureAtMaxBreakPoint, ) print( "Surface 2 Curvature At Max Break Point:", result.surface2CurvatureAtMaxBreakPoint, ) print( "Surface 1 Curvature At Min Break Point:", result.surface1CurvatureAtMinBreakPoint, ) print( "Surface 2 Curvature At Min Break Point:", result.surface2CurvatureAtMinBreakPoint, ) print("Break Angle Max:", result.breakAngleMax) print("Break Angle Min:", result.breakAngleMin) print("Break Angle Average:", result.breakAngleAvg)
Return the curvature for surfaces attached to edges with IDs 1 - 100#import hm import hm.entities as ent model = hm.Model() edge_collection = hm.Collection(model, ent.Line, list(range(1, 101))) _, resultlist = model.hm_getsurfacecurvatureforedges(collection=edge_collection) for result in resultlist: print("Edge:", result.edge.id) print("Surface 1:", result.surface1_id) print("Surface 1 Curvature Max:", result.surface1CurvatureMax) print("Surface 1 Curvature Min:", result.surface1CurvatureMin) print("Surface 1 Curvature Average:", result.surface1CurvatureAvg) print("Surface 2:", result.surface2_id) print("Surface 2 Curvature Max:", result.surface2CurvatureMax) print("Surface 2 Curvature Min:", result.surface2CurvatureMin) print("Surface 2 Curvature Average:", result.surface2CurvatureAvg) print( "Surface 1 Curvature At Max Break Point:", result.surface1CurvatureAtMaxBreakPoint, ) print( "Surface 2 Curvature At Max Break Point:", result.surface2CurvatureAtMaxBreakPoint, ) print( "Surface 1 Curvature At Min Break Point:", result.surface1CurvatureAtMinBreakPoint, ) print( "Surface 2 Curvature At Min Break Point:", result.surface2CurvatureAtMinBreakPoint, ) print("Break Angle Max:", result.breakAngleMax) print("Break Angle Min:", result.breakAngleMin) print("Break Angle Average:", result.breakAngleAvg)
Return the curvature for surfaces attached to edges with IDs 1 - 100 , use an offset size of 4.5#import hm import hm.entities as ent model = hm.Model() edge_collection = hm.Collection(model, ent.Line, list(range(1, 101))) _, resultlist = model.hm_getsurfacecurvatureforedges(collection=edge_collection, offset="4.5") for result in resultlist: print("Edge:", result.edge.id) print("Surface 1:", result.surface1_id) print("Surface 1 Curvature Max:", result.surface1CurvatureMax) print("Surface 1 Curvature Min:", result.surface1CurvatureMin) print("Surface 1 Curvature Average:", result.surface1CurvatureAvg) print("Surface 2:", result.surface2_id) print("Surface 2 Curvature Max:", result.surface2CurvatureMax) print("Surface 2 Curvature Min:", result.surface2CurvatureMin) print("Surface 2 Curvature Average:", result.surface2CurvatureAvg) print( "Surface 1 Curvature At Max Break Point:", result.surface1CurvatureAtMaxBreakPoint, ) print( "Surface 2 Curvature At Max Break Point:", result.surface2CurvatureAtMaxBreakPoint, ) print( "Surface 1 Curvature At Min Break Point:", result.surface1CurvatureAtMinBreakPoint, ) print( "Surface 2 Curvature At Min Break Point:", result.surface2CurvatureAtMinBreakPoint, ) print("Break Angle Max:", result.breakAngleMax) print("Break Angle Min:", result.breakAngleMin) print("Break Angle Average:", result.breakAngleAvg)