UF_BREP_ask_geometry
Defined in: uf_brep.h
int UF_BREP_ask_geometry(const UF_BREP_topology_t * topology, const UF_BREP_options_t * options, const UF_BREP_mapping_t * mapping, UF_BREP_geometry_t * geometry, UF_BREP_orientation_t * geom_sense, int * num_states, UF_BREP_state_t * * states )
overview 概述
The given geometry is queried from the model and returned in the application-supplied structure. Any arrays needed (for example in b-surfaces and extruded surfaces) are allocated by Open API and must be freed with UF_free, or with UF_BREP_free_geometry_data.
For curves, geom_sense is forward if the curve tangent is pointing in the same direction as traversing the edge from the start vertex to the end vertex. For surfaces, geom_sense is forward if the surface normal points in the face normal direction (which the loop direction determines).
Special attention is given to geometries that cannot be returned without approximation. Blend surfaces, intersection edges, and tolerant edges have no direct representation in available geometry types. Therefore, when requesting data for a face or edge, the mappings and tolerances must always be supplied in the respective structures. Applications sometimes provide different tolerances for faces and edges, or for different types of surfaces or curves. This function's results are undefined if any function that changes the body's topology is used between the time UF_BREP_ask_topology is called and the time this function is called. This includes any feature changes or any other modelling operation.
Geometry may be asked on a topology being used to create a body. It is important to realize that when asking for fin geometry for a tolerant edge, the SP curves returned were produced at the time the edge was made tolerant (when it was modelled). Its accuracy was determined at that time. Such curves are returned by this function as they were constructed when made. Setting a smaller tolerance for this function does not improve their accuracy. A smaller tolerance in this function only improves the accuracy of curves or surfaces that must be approximated by this function.
从模型中查询给定的几何图形,并在应用程序提供的结构中返回。任何需要的数组(例如 b 曲面和挤压曲面)都由 Open API 分配,必须使用 UF _ free 或 UF _ BREP _ free _ ç _ data 释放。对于曲线,如果曲线切线指向与从起点到终点的边沿相同的方向,则 geom _ sense 是向前的。对于表面,如果表面法线指向表面法线方向(由循环方向决定) ,则 geom _ sense 是向前的。特别注意那些没有近似就不能返回的几何形状。混合曲面、交叉边和容差边在可用的几何类型中没有直接表示。因此,当请求面或边的数据时,映射和公差必须始终在各自的结构中提供。应用程序有时提供不同的公差面和边缘,或不同类型的表面或曲线。如果在调用 UF _ BREP _ ask _ 拓扑和调用此函数之间使用了任何改变主体拓扑的函数,则此函数的结果是未定义的。这包括任何功能更改或任何其他建模操作。在用于创建物体的拓扑结构上可能会问到几何学。重要的是要认识到,当要求鱼鳍几何宽容的边缘时,返回的 SP 曲线是在边缘宽容时产生的(当它被建模)。它的准确性是在那个时候确定的。这样的曲线是由这个函数返回的,因为它们是在构造的时候被构造出来的。为这个函数设置较小的公差并不能提高它们的准确性。这个函数中较小的公差只能提高必须用这个函数近似的曲线或曲面的精度。
UFUN例子
获取源码例子请搜索 里海NX二次开发3000例专栏
parameters 参数
| const UF_BREP_topology_t * | topology | Input | Pointer to topology item structure defining geometry to be returned 指向拓扑项结构的指针,该结构定义要返回的几何图形 |
| const UF_BREP_options_t * | options | Input | Applicable options: All tolerances for edge and fin curves, and for surfaces, should be specified. 适用选项: 所有的边缘和翅片曲线的公差,以及表面,应指定。 |
| const UF_BREP_mapping_t * | mapping | Input | Surface and curve type mappings to cause output to be in b-spline geometry. 曲面和曲线类型映射使输出为 b 样条几何。 |
| UF_BREP_geometry_t * | geometry | Input | Pointer to geometry structure to receive the description. 指向几何结构以接收说明的指针。 |
| UF_BREP_orientation_t * | geom_sense | Input / Output | Input: Geometry orientation with respect to the topology entity. For faces, fins, and edges: UF_BREP_ORIENTATION_FORWARD or UF_BREP_ORIENTATION_REVERSE. Otherwise UF_BREP_ORIENTATION_NONE. Output: Pointer to geometry structure to receive the description. 输入: 相对于拓扑实体的几何方向。对于面、鳍和边: UF _ BREP _ ORIENTATION _ FORWARD 或 UF _ BREP _ ORIENTATION _ REVERSE。否则 UF _ BREP _ OIENTATION _ NONE。输出: 指向几何结构以接收说明的指针。 |
| int * | num_states | Output | number of states in the states array 状态数组中的状态数 |
| UF_BREP_state_t * * | states | Output to UF_free | UF_BREP allocated array. If the caller passes in a NULL, UF_BREP does not allocate the array. This should be freed by calling UF_free. UF _ BREP 分配数组。如果调用方传入 NULL,则 UF _ BREP 不会分配数组。这应该通过调用 UF _ free 来释放。 |