yucad3d

yucad3d SDK Guide

Extend yucad3d from outside the application: a plugin is a DLL exporting one entry point, or a Lua script running in the embedded sandbox. Both reach the SAME seams the built-in modules use — node types the host persists and draws, commands, properties.

How a plugin works

The contract: yu3d_plugin_register, the host table, node types with an opaque payload, and what happens to a document whose plugin is missing.

Build your first plugin

A minimal node type end to end — register, serialise, draw, and add one command that creates it.

Host API functions

All 118 functions of Yu3dHostApi, grouped and searchable. Generated from the header.

Types & constants

Callbacks you implement, descriptor structs you fill in, and the versioning constants.

Lua sandbox

Sandboxed scripting over the same seams, for automation that does not warrant a compiled plugin.

Python scripting

Embedded CPython with the yu3d module — the ecosystem you already have, at plugin-level trust (NOT sandboxed).

Which face should I use?

You want to…Use
add a persistent node type with its own geometryC ABI plugin
ship a command that batch-edits a documenta script; Lua is sandboxed, Python brings its ecosystem
integrate a solver or a proprietary formatC ABI plugin
automate a repetitive drafting taskLua script
use numpy / pandas / your own Python librariesPython script (runs unsandboxed — trust it like a plugin)

Compatibility in one paragraph

The ABI version is a MAJOR number (YU3D_PLUGIN_ABI_VERSION, currently 1u). Compatible growth is append-only: new functions go to the END of the host table and struct_size grows, so a plugin built against an older header keeps working because every field it knows still sits at the same offset. Anything that would move or repurpose a field bumps the major instead. Guard any field newer than your baseline with YU3D_HOST_HAS(host, field).

Two of these pages are generated. Host API functions and Types & constants are produced from sdk/include/yu3d_plugin.h, so they cannot drift from the header you compile against.