Rotation support
The Factory system from yesterday could place and size geometry, but everything was axis-aligned. Today we added rotation support with round-trip preservation — rotate a piece, export the layout to a table, reimport it, and the rotation is exactly what you specified. No floating-point drift.
This sounds trivial but Roblox makes it tricky. CFrames store rotation as a 3x3 matrix internally. Converting between Euler angles (CFrame.Angles) and the matrix representation accumulates floating-point error on each conversion. After a save-load-save cycle, your 45-degree rotation might be 44.99999 degrees. Over many cycles, it drifts.
Our solution: store the original Euler angles as metadata alongside the CFrame. The CFrame is used for rendering and physics; the Euler angles are used for serialization. Round-tripping reads the metadata, not the matrix.
The Lichtervelde Cathedral
To prove the system works at scale, we built a model of a cathedral inspired by the Church of the Immaculate Conception in Lichtervelde, Belgium. Gothic arches, a nave with side aisles, a bell tower.
The real test was CSG (Constructive Solid Geometry) for windows and doorways. CSG lets you subtract one shape from another — position an arch-shaped block where you want a window, perform a SubtractAsync operation, and Roblox carves it out of the wall.
CSG in Roblox is powerful but temperamental. We documented a set of hard-won rules:
- Always parent parts to Workspace before CSG operations.
SubtractAsyncsilently fails (returns a zero-size part) if either operand isn’t a descendant of Workspace. This is undocumented and cost us an hour of debugging. - Keep negative parts simple. Using a complex UnionOperation as a cutter sometimes produces corrupt geometry. Stick to primitive shapes (Block, Cylinder, Wedge).
- Check the result’s size. Failed CSG operations return a valid Part with
Size = Vector3.new(0,0,0). There’s no error, no warning. You have to check explicitly. - Separate visual CSG from collision geometry. CSG unions sometimes produce collision meshes that don’t match the visual mesh. Players can walk through visible walls or collide with invisible ones. When this happens, keep the CSG union for visuals but add invisible Parts for collision.
The cathedral rendered beautifully and proved the Factory can handle real architectural complexity — multiple floors, rotated elements, hundreds of CSG operations. It also surfaced every edge case in the system, which is exactly why we built something ambitious instead of another test cube.