Feature Templates
I want to start getting sketching and other features working and created a reusable object oriented way to make them.
This forced me to learn a lot about TypeScript and I’m not even sure if I understand it now. But the end result is a Tool
class that has a Zod schema defining the parameter types for the tool’s
callback function. The function is automatically typed based on the
schema, as well as a defaults object. This was crazy
complicated because I had to juggle generic types, static vs instance
properties, and a bunch of other weird typing stuff.
There’s not much to show here but now when I click a feature a pop-up
shows the parameter names and types. Next I’ll write a UI “generator”
which has inputs for the parameter, even custom types like faces/planes.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.