|
OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
|
OCCT-Light: Wavefront OBJ file I/O. More...


Go to the source code of this file.
Classes | |
| struct | occtl_io_obj_read_options |
| struct | occtl_io_obj_write_options |
Macros | |
| #define | OCCTL_IO_OBJ_READ_OPTIONS_VERSION_1 1u |
| #define | OCCTL_IO_OBJ_WRITE_OPTIONS_VERSION_1 1u |
| #define | OCCTL_IO_OBJ_READ_OPTIONS_INIT |
| #define | OCCTL_IO_OBJ_WRITE_OPTIONS_INIT |
Typedefs | |
| typedef enum occtl_io_obj_coordinate_system | occtl_io_obj_coordinate_system_t |
| typedef struct occtl_io_obj_read_options | occtl_io_obj_read_options_t |
| typedef struct occtl_io_obj_write_options | occtl_io_obj_write_options_t |
Enumerations | |
| enum | occtl_io_obj_coordinate_system { OCCTL_IO_OBJ_COORDINATE_SYSTEM_Y_UP = 0 , OCCTL_IO_OBJ_COORDINATE_SYSTEM_Z_UP = 1 , OCCTL_IO_OBJ_COORDINATE_SYSTEM_GLTF = 2 , OCCTL_IO_OBJ_COORDINATE_SYSTEM_RESERVED_FUTURE = 0x7fffffff } |
Functions | |
| void | occtl_io_obj_read_options_init (occtl_io_obj_read_options_t *options) |
| void | occtl_io_obj_write_options_init (occtl_io_obj_write_options_t *options) |
| occtl_status_t | occtl_io_obj_read (const char *path, occtl_graph_t **out_graph, occtl_node_id_t *out_root, const occtl_io_obj_read_options_t *options) |
| occtl_status_t | occtl_io_obj_write (const occtl_graph_t *graph, occtl_node_id_t root, const char *path, const occtl_io_obj_write_options_t *options) |
OCCT-Light: Wavefront OBJ file I/O.
Reads and writes Wavefront OBJ mesh files via OCCT's DEOBJ_Provider / DEOBJ_ConfigurationNode.
OBJ is primarily a polygon mesh exchange format. Precise geometry may be tessellated during export; callers that need deterministic triangulation should run occtl_mesh_generate before writing.
UIDs are not preserved across the round-trip in v1. Use occtl_uid_to_bytes / occtl_uid_from_bytes for an out-of-band UID handshake if persistent identity is required.
| #define OCCTL_IO_OBJ_READ_OPTIONS_INIT |
| #define OCCTL_IO_OBJ_WRITE_OPTIONS_INIT |
Coordinate system used by OBJ import/export conversion.
| typedef struct occtl_io_obj_read_options occtl_io_obj_read_options_t |
Options for occtl_io_obj_read. Pass NULL for defaults.
| typedef struct occtl_io_obj_write_options occtl_io_obj_write_options_t |
Options for occtl_io_obj_write. Pass NULL for defaults.
| occtl_status_t occtl_io_obj_read | ( | const char * | path, |
| occtl_graph_t ** | out_graph, | ||
| occtl_node_id_t * | out_root, | ||
| const occtl_io_obj_read_options_t * | options | ||
| ) |
Reads an OBJ file and ingests it into a freshly-created graph.
| [in] | path | Borrows it. NUL-terminated UTF-8 path to the file. Must be non-NULL. |
| [out] | out_graph | Owns it. Receives a new graph on success; NULL on failure. |
| [out] | out_root | Borrows it. Receives the NodeId of the root entity. |
| [in] | options | Borrows it. May be NULL for defaults. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | path, out_graph, or out_root is NULL; or options has invalid fields (non-NULL p_next, non-finite/non-positive file_length_unit_m, invalid 0/1 flags, negative memory_limit_mib other than -1). |
| OCCTL_VERSION_MISMATCH | options has an unsupported struct_version. |
| OCCTL_OUT_OF_RANGE | options has an unsupported coordinate-system value. |
| OCCTL_IO_ERROR | File not found, unreadable, or blocked by OCCT reader limits. |
| OCCTL_FORMAT_ERROR | File contents were not a valid OBJ stream. |
| OCCTL_TOPOLOGY_INVALID | Imported shape could not be ingested into BRepGraph. |
\par Thread Safety Yes.
| void occtl_io_obj_read_options_init | ( | occtl_io_obj_read_options_t * | options | ) |
Initialises options to default values matching OCCTL_IO_OBJ_READ_OPTIONS_INIT.
NULL-tolerant.
| [out] | options | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_io_obj_write | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | root, | ||
| const char * | path, | ||
| const occtl_io_obj_write_options_t * | options | ||
| ) |
Writes the topology rooted at root to an OBJ file.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | root | Root node id to serialise. |
| [in] | path | Borrows it. NUL-terminated UTF-8 path; existing file is overwritten. |
| [in] | options | Borrows it. May be NULL for defaults. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or path is NULL; or options->p_next is non-NULL. |
| OCCTL_NOT_FOUND | root is invalid or has been removed. |
| OCCTL_VERSION_MISMATCH | options has an unsupported struct_version. |
| OCCTL_OUT_OF_RANGE | options has an unsupported coordinate-system value. |
| OCCTL_IO_ERROR | Filesystem failure, unwritable file, or OCCT writer failure. |
\par Thread Safety Yes (read-only on graph).
| void occtl_io_obj_write_options_init | ( | occtl_io_obj_write_options_t * | options | ) |
Initialises options to default values matching OCCTL_IO_OBJ_WRITE_OPTIONS_INIT.
NULL-tolerant.
| [out] | options | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.