OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
Loading...
Searching...
No Matches
occtl_heal.h File Reference

OCCT-Light: shape healing module. More...

#include <stddef.h>
#include <stdint.h>
#include "occtl_core.h"
#include "occtl_topo.h"
Include dependency graph for occtl_heal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  occtl_heal_options
 
struct  occtl_heal_unify_same_domain_options
 

Macros

#define OCCTL_HEAL_OPTIONS_VERSION_1   1u
 
#define OCCTL_HEAL_OPTIONS_INIT    {OCCTL_HEAL_OPTIONS_VERSION_1, NULL, OCCTL_HEAL_MODE_STANDARD, 0.0, 1, 1, 1, 0}
 
#define OCCTL_HEAL_UNIFY_SAME_DOMAIN_OPTIONS_VERSION_1   1u
 
#define OCCTL_HEAL_UNIFY_SAME_DOMAIN_OPTIONS_INIT    {OCCTL_HEAL_UNIFY_SAME_DOMAIN_OPTIONS_VERSION_1, NULL, 1, 1, 0, 0, 1, 0.0, 0.0}
 

Typedefs

typedef enum occtl_heal_mode occtl_heal_mode_t
 
typedef struct occtl_heal_options occtl_heal_options_t
 
typedef struct occtl_heal_unify_same_domain_options occtl_heal_unify_same_domain_options_t
 

Enumerations

enum  occtl_heal_mode { OCCTL_HEAL_MODE_BASIC = 0 , OCCTL_HEAL_MODE_STANDARD = 1 , OCCTL_HEAL_MODE_FULL = 2 , OCCTL_HEAL_MODE_RESERVED_FUTURE = 0x7fffffff }
 

Functions

void occtl_heal_options_init (occtl_heal_options_t *options)
 
void occtl_heal_unify_same_domain_options_init (occtl_heal_unify_same_domain_options_t *options)
 
occtl_status_t occtl_heal_shape (occtl_graph_t *graph, occtl_node_id_t node_id, const occtl_heal_options_t *options)
 
occtl_status_t occtl_heal_unify_same_domain (occtl_graph_t *graph, occtl_node_id_t node_id, const occtl_heal_unify_same_domain_options_t *options, occtl_node_id_t *out_root)
 

Detailed Description

OCCT-Light: shape healing module.

Exposes OCCT's ShapeFix, ShapeAnalysis, ShapeProcess, and ShapeUpgrade toolkits for repairing and validating CAD geometry.

Typedef Documentation

◆ occtl_heal_mode_t

Healing mode selector.

Controls which family of OCCT repair tools is activated during occtl_heal_shape. Each mode is cumulative — the higher modes include every check from the lower ones.

◆ occtl_heal_options_t

Versioned options for shape healing.

Call occtl_heal_options_init for a runtime fill; use OCCTL_HEAL_OPTIONS_INIT for static zero-cost initialisation. Pass NULL as the options argument to occtl_heal_shape to accept every default.

◆ occtl_heal_unify_same_domain_options_t

Versioned options for unifying same-domain edges and faces.

Call occtl_heal_unify_same_domain_options_init for a runtime fill; use OCCTL_HEAL_UNIFY_SAME_DOMAIN_OPTIONS_INIT for static zero-cost initialisation. Pass NULL as the options argument to occtl_heal_unify_same_domain to accept every default.

Enumeration Type Documentation

◆ occtl_heal_mode

Healing mode selector.

Controls which family of OCCT repair tools is activated during occtl_heal_shape. Each mode is cumulative — the higher modes include every check from the lower ones.

Enumerator
OCCTL_HEAL_MODE_BASIC 

Fix basic issues: wire reorder, wire connected, wire-on-face.

OCCTL_HEAL_MODE_STANDARD 

Standard fix: basic + face orientation, shell/solid closure.

OCCTL_HEAL_MODE_FULL 

Full fix: standard + SameParameter, seam, small-edge.

Function Documentation

◆ occtl_heal_options_init()

void occtl_heal_options_init ( occtl_heal_options_t options)

Runtime initialiser for occtl_heal_options_t.

Parameters
[out]optionsBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_heal_shape

◆ occtl_heal_shape()

occtl_status_t occtl_heal_shape ( occtl_graph_t graph,
occtl_node_id_t  node_id,
const occtl_heal_options_t options 
)

Performs shape healing on a shape referenced by node_id.

Wraps ShapeFix_Shape from OCCT's TKShHealing toolkit. The healed shape is ingested back into graph as a new topology root (the old node is unaffected). Caller must ensure exclusive access to the graph during the call.

Parameters
[in,out]graphBorrows it. Must be non-NULL.
[in]node_idNode whose OCCT shape will be healed. The node must resolve to a valid, non-null shape.
[in]optionsBorrows it. May be NULL for defaults (OCCTL_HEAL_OPTIONS_INIT).
Return values
OCCTL_OKHealing completed (may produce warnings).
OCCTL_INVALID_ARGUMENTgraph is NULL; or options has invalid fields (non-NULL p_next, non-finite/negative tolerance, non-0/1 fix flags).
OCCTL_NOT_FOUNDnode_id does not resolve to a valid shape.
OCCTL_VERSION_MISMATCHUnsupported struct_version in options.
OCCTL_OUT_OF_RANGEoptions->mode is outside supported enum values.
OCCTL_TOPOLOGY_INVALIDThe healed result could not be added to the graph.

\par Thread Safety No — mutates the graph.

See also
occtl_heal_options_init

◆ occtl_heal_unify_same_domain()

occtl_status_t occtl_heal_unify_same_domain ( occtl_graph_t graph,
occtl_node_id_t  node_id,
const occtl_heal_unify_same_domain_options_t options,
occtl_node_id_t out_root 
)

Unifies same-domain edges and faces of a shape.

Wraps OCCT's ShapeUpgrade_UnifySameDomain. The unified shape is ingested back into graph as a new topology root; the original node is unaffected.

Parameters
[in,out]graphBorrows it. Must be non-NULL.
[in]node_idNode whose OCCT shape will be unified.
[in]optionsBorrows it. May be NULL for defaults (OCCTL_HEAL_UNIFY_SAME_DOMAIN_OPTIONS_INIT).
[out]out_rootBorrows it. Receives the new topology root. Must be non-NULL.
Return values
OCCTL_OKShape was unified and ingested.
OCCTL_INVALID_ARGUMENTgraph or out_root is NULL; or options has invalid fields (non-NULL p_next, non-0/1 flags, non-finite/negative tolerances).
OCCTL_NOT_FOUNDnode_id does not resolve to a valid shape.
OCCTL_VERSION_MISMATCHUnsupported struct_version in options.
OCCTL_TOPOLOGY_INVALIDThe unified result could not be added to the graph.

\par Thread Safety No — mutates the graph.

See also
occtl_heal_unify_same_domain_options_init

◆ occtl_heal_unify_same_domain_options_init()

void occtl_heal_unify_same_domain_options_init ( occtl_heal_unify_same_domain_options_t options)

Runtime initialiser for occtl_heal_unify_same_domain_options_t.

Parameters
[out]optionsBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_heal_unify_same_domain