NX/UG二次开发—Parasolid—PK_EDGE_ask_convexity

判断实体边的凸凹性

Convexity

Value

Example

convex

PK_EDGE_convexity_convex_c

concave

PK_EDGE_convexity_concave_c

variable
the convexity varies along the edge

PK_EDGE_convexity_variable_c

smooth flat
parallel surface normals, both faces have zero face curvature

PK_EDGE_convexity_smooth_flat_c

smooth convex
edge convexity is smooth, both faces have positive curvature (or one has zero, one has positive)

PK_EDGE_convexity_smooth_cvx_c

smooth concave
edge convexity is smooth, both faces have negative curvature (or one has zero, one has negative)

PK_EDGE_convexity_smooth_ccv_c

smooth inflection
edge convexity is smooth, faces have opposite curvature

PK_EDGE_convexity_smooth_inf_c

smooth variable

edge convexity is smooth, some parts are smooth convex, some parts are smooth concave

PK_EDGE_convexity_smooth_var_c

knife convex
surface normals are anti-parallel and the sum of the curvatures is non-negative

PK_EDGE_convexity_knife_cvx_c

knife concave
surface normals are anti-parallel and the sum of the curvatures is non-positive

PK_EDGE_convexity_knife_ccv_c

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
下面是一个示例,展示如何使用 Parasolid API 中的 PK_BODY_pick_topols 函数: ``` #include "PKAPI/PKAPI.h" // 定义一个函数,用于在给定的实体上选择拓扑结构 void selectTopology(PK_PART_t *part, PK_BODY_t *body) { // 定义一个拓扑选择器 PK_TOPOLOGY_SELECT_t *selector = PK_TOPOLOGY_SELECT_create(); // 设置选择器的模式为“单选” PK_TOPOLOGY_SELECT_set_mode(selector, PK_TOPOLOGY_SELECT_MODE_SINGLE); // 使用 PK_BODY_pick_topols 函数选择拓扑结构 int num_topols = 0; PK_TOPOLOGY_t **topols = PK_BODY_pick_topols(body, selector, &num_topols); // 输出选择的拓扑结构的数量 printf("Selected %d topologies:\n", num_topols); // 遍历选择的拓扑结构并输出它们的类型和 ID for (int i = 0; i < num_topols; i++) { PK_TOPOLOGY_t *topol = topols[i]; printf(" Topology %d: type=%d, ID=%d\n", i, PK_TOPOLOGY_get_type(topol), PK_TOPOLOGY_get_id(topol)); } // 释放选择器和拓扑结构数组 PK_TOPOLOGY_SELECT_destroy(selector); PK_TOPOLOGY_delete_array(topols, num_topols); } int main() { // 初始化 Parasolid API PK_INITIALIZE(""); // 打开一个示例文件 PK_PART_t *part = PK_PART_open("example.x_t"); // 获取文件中的所有实体 int num_bodies = 0; PK_BODY_t **bodies = PK_PART_ask_bodies(part, &num_bodies); // 遍历实体并选择它们的拓扑结构 for (int i = 0; i < num_bodies; i++) { PK_BODY_t *body = bodies[i]; printf("Selecting topologies for body %d:\n", i); selectTopology(part, body); } // 释放实体数组和文件 PK_BODY_delete_array(bodies, num_bodies); PK_PART_close(part); // 终止 Parasolid API PK_TERMINATE(""); return 0; } ``` 该示例首先初始化 Parasolid API,然后打开一个名为 "example.x_t" 的示例文件。然后,它获取文件中的所有实体,并使用 PK_BODY_pick_topols 函数选择每个实体的拓扑结构。最后,它释放实体数组和文件,并终止 Parasolid API。 在 selectTopology 函数中,我们首先创建一个拓扑选择器,并将其模式设置为“单选”。然后,我们使用 PK_BODY_pick_topols 函数选择拓扑结构,并输出选择的拓扑结构的数量和类型/ID。最后,我们释放选择器和拓扑结构数组。 请注意,此示例仅演示了如何使用 PK_BODY_pick_topols 函数选择拓扑结构。在实际应用中,您可能需要进一步处理所选的拓扑结构,并执行其他操作,例如修改它们的属性或创建新的实体。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

恩·艾克斯·红

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值