Summary
Virtually everything that you interact with on a daily basis and many other things that make modern life possible were designed and modeled in software called CAD or Computer-Aided Design. These programs are advanced suites with graphical editing environments tailored to domain experts in areas such as mechanical engineering, electrical engineering, architecture, etc. While the UI-driven workflow is more accessible, it isn’t scalable which opens the door to code-driven workflows. In this episode Jeremy Wright discusses the design, uses, and benefits of the CadQuery framework for building 3D CAD models entirely in Python.
Announcements
- Hello and welcome to Podcast.__init__, the podcast about Python’s role in data and science.
- When you’re ready to launch your next app or want to try a project you hear about on the show, you’ll need somewhere to deploy it, so take a look at our friends over at Linode. With their managed Kubernetes platform it’s easy to get started with the next generation of deployment and scaling, powered by the battle tested Linode platform, including simple pricing, node balancers, 40Gbit networking, dedicated CPU and GPU instances, and worldwide data centers. And now you can launch a managed MySQL, Postgres, or Mongo database cluster in minutes to keep your critical data safe with automated backups and failover. Go to pythonpodcast.com/linode and get a $100 credit to try out a Kubernetes cluster of your own. And don’t forget to thank them for their continued support of this show!
- So now your modern data stack is set up. How is everyone going to find the data they need, and understand it? Select Star is a data discovery platform that automatically analyzes & documents your data. For every table in Select Star, you can find out where the data originated, which dashboards are built on top of it, who’s using it in the company, and how they’re using it, all the way down to the SQL queries. Best of all, it’s simple to set up, and easy for both engineering and operations teams to use. With Select Star’s data catalog, a single source of truth for your data is built in minutes, even across thousands of datasets. Try it out for free and double the length of your free trial today at pythonpodcast.com/selectstar. You’ll also get a swag package when you continue on a paid plan.
- Need to automate your Python code in the cloud? Want to avoid the hassle of setting up and maintaining infrastructure? Shipyard is the premier orchestration platform built to help you quickly launch, monitor, and share python workflows in a matter of minutes with 0 changes to your code. Shipyard provides powerful features like webhooks, error-handling, monitoring, automatic containerization, syncing with Github, and more. Plus, it comes with over 70 open-source, low-code templates to help you quickly build solutions with the tools you already use. Go to dataengineeringpodcast.com/shipyard to get started automating with a free developer plan today!
- Your host as usual is Tobias Macey and today I’m interviewing Jeremy Wright about CadQuery, an easy-to-use Python module for building parametric 3D CAD models
Interview
- Introductions
- How did you get introduced to Python?
- Can you start by explaining what CAD is and some of the real-world applications of it?
- Can you describe what CadQuery is and the story behind it?
- How did you get involved with it and what keeps you motivated?
- What are the different methods that are in common use for building CAD models?
- Are there approaches that are more common for models used in different industries?
- What was missing in other projects for programmatically generating CAD models that motivated you to build CadQuery?
- Can you describe how the CadQuery library is implemented?
- How have the design and goals of the project changed or evolved since you started working on it?
- How would you characterize the rate of change/evolution in the CAD ecosystem, and how has that factored into your work on CadQuery?
- How did you approach the process of API design?
- How do you balance accessibility for non-professionals with domain-related nomenclature?
- Can you describe some example workflows for going from idea to finished product with CadQuery?
- How are you using CadQuery in your own work?
- What are the most interesting, innovative, or unexpected ways that you have seen CadQuery used?
- What are the most interesting, unexpected, or challenging lessons that you have learned while working on CadQuery?
- When is CadQuery the wrong choice?
- What do you have planned for the future of CadQuery?
Keep In Touch
Picks
Closing Announcements
- Thank you for listening! Don’t forget to check out our other shows. The Data Engineering Podcast covers the latest on modern data management. The Machine Learning Podcast helps you go from idea to production with machine learning.
- Visit the site to subscribe to the show, sign up for the mailing list, and read the show notes.
- If you’ve learned something or tried out a project from the show then tell us about it! Email hosts@podcastinit.com) with your story.
- To help other people find the show please leave a review on iTunes and tell your friends and co-workers
Links
- CadQuery
- CAD == Computer Assisted Design
- 3D Printer
- Jeremy’s CNC Router
- jQuery
- Blender
- Fusion 360
- Open Cascade (OCCT)
- Fluent API
- FreeCAD
- KiCAD
- Semblage
- cq-editor
- jupyter-cadquery
- cq-kit
- FX Bricks
- Voxels
- cq_warehouse
The intro and outro music is from Requiem for a Fish The Freak Fandango Orchestra / CC BY-SA
Hello, and welcome to podcast dot in it, the podcast about Python and the people who make it great. So now your modern data stack is set up. How is everyone going to find the data they need and understand it? Select STAR is a data discovery platform that automatically analyzes and documents your data. For every table in select STAR, you can find out where the data originated, which dashboards are built on top of it, who's using it in the company and how they're using it, all the way down to the SQL queries. Best of all, it's simple to set up and easy for both engineering and operations teams to use.
With SelectStar's data catalog, a single source of truth for your data is built in minutes, even across thousands of datasets. Try it out for free and double the length of your free trial today at python podcast dotcom/selectstar. You'll also get a swag package when you continue on a paid plan. When you're ready to launch your next app or want to try a project you hear about on the show, you need somewhere to deploy it. So check out our friends over at Linode. With their managed Kubernetes platform, it's easy to get started with the next generation of deployment and scaling powered by the battle tested Linode platform, including simple pricing, node balancers, 40 gigabit networking, and dedicated CPU and GPU instances.
And now you can launch a managed MySQL, Postgres, or Mongo database cluster in minutes to keep your critical data safe with automated backups and failover. Go to python podcast.com/linode today to get a $100 credit to try out their new database service, and don't forget to thank them for their continued support of this show. Your host as usual is Tobias Macy. And today, I'm interviewing Jeremy Wright about CAD Query, an easy to use Python module for building parametric 3 d CAD models. So, Jeremy, can you start by introducing yourself?
[00:01:56] Unknown:
First of all, thank you for having me on. My name is Jeremy Wright, and I am a core developer, core contributor for the Cad Query, and have been for several years now,
[00:02:07] Unknown:
heavy Python user because of Cad Query. Glad to be on. And do you remember how you first got introduced to Python?
[00:02:14] Unknown:
I saw Python off and on in books, usually at like a Barnes and Noble bookseller years years ago and would leaf through them. And the syntax and the design of the language really clicked with me. I'm actually a self taught programmer and a mechanical engineer. So I'm not not a natural programmer. So looking at the books, I thought Python made a lot of sense to me. I liked the way it was designed, but I didn't really get to use it much until I got involved with the Cad Query project in about 2014.
[00:02:47] Unknown:
And that project kind of pushed it into being a daily driver language for me. Before we get too much further into the discussion about the Cadbury project itself, I'm wondering if you can just give a bit of an overview for people who aren't familiar with what CAT is and some of the ways that it's used in real world designs or different things that they might interact with every day that were actually built with CAD as part of their workflow or as part of their sort of development life cycle?
[00:03:11] Unknown:
Yeah. CAD is very integral to our daily lives, even though we don't interact with it directly a lot of times. The simplest definition would be that CAD is software that allows a user to create a 2 d or 3 d object, which is then usually manufactured in the real world using things like 3 d printers, vinyl cutters, CNC routers, things like that. They don't have to be manufactured in the real world. CAD can be used to create assets for video games or digital art or things like that. And so everything from the car you drive to the toaster you use, everything pretty much has been designed with CAD.
[00:03:48] Unknown:
Most likely the house that you're sitting in as well because my father's a carpenter, and so I've seen him do some CAD design drawings for architectural diagrams for buildings.
[00:03:57] Unknown:
Yeah. Absolutely. Yep.
[00:03:59] Unknown:
With that context, can you describe a bit about what the CAD Query project is and some of the story behind it and how you got involved with it? Cad Query is a Python API that attempts to
[00:04:10] Unknown:
create CAD objects in a way that we hope fits the way a person thinks about the design and about the way it should be made, and captures their design intent. So what that means in practice is that the user may start with a block of metal, like steel, and say, I wanna drill 2 holes in the top of the block. Part of their design intent is that they always want the hole to start from the top face, even if there's a chip off of 1 side or you have, you know, chamfers and angles or rounds on the sides. And so a programmer can actually tell Cad Query what they want to do explicitly using what we call selectors.
And a selector just tells Cadbury that no matter what else I do to this block, no matter how else it changes, I want you to put the holes on this face. There's a lot more to what Cadbury does, but that is 1 of the core tenets of it. That kind of ties into the creator of Cad Query, Dave Cowden, how he came about creating Cad Query was that he was talking to a coworker who was a programmer. And the coworker was really intimidated. They wanted to create a mechanical design, but they were intimidated by commercial CAD packages because they had to learn all the ins and outs of the software. But then they also had to learn how to do mechanical design properly at the same time.
But Dave felt that the ways programmer thinks about a problem and goes about solving a problem is already kind of a great fit for the way you go about generating a mechanical design. And at the same time, Dave was doing web development and working with jQuery. And you'll notice the similarity between the name jQuery and Cad Query. And he made connections between how selectors are used in CAD Query or in jQuery for the HTML DOM of a webpage to make changes on the fly. And connected that with some of his thoughts and other musings on how developers go about problems involved category.
And so I think it was around 2012 or so, maybe 2013, that Dave open sourced Cad Query, and it was on GitHub. Life kind of was keeping him busy in other areas. And I came along and discovered it and got involved and have been ever since. So it was about 2014.
[00:06:39] Unknown:
Now that you are involved with it, what is it about this project and the problem space that it's addressing that keeps you interested and motivated to keep developing and maintaining the project?
[00:06:49] Unknown:
I think, well, I use it for 1, and so it scratches that itch. And it's something that I do like. I come from a mechanical engineering background where I'm used to using commercial point and click mouse driven CAD. And I do like some aspects of that. But there are just so many things about the flexibility and power that I get from Cad Query that it makes it well worth using. And I also enjoy the community, watching how creative the community is, the way they solve problems. A lot of times there are things that I don't know how to do, and I can ask the community, and sure enough, somebody will figure out how to do it. As you mentioned, the majority of commercial CAD programs are very UI driven, point and click, maybe type in a few instructions,
[00:07:34] Unknown:
but they're not going to be as automated or automatable as a pure software package. But with the pure software package, you have to envision everything before you can really see it rendered out. I know that there are some GUI modules for being able to get some back and forth interplay using Cad Query, but I'm wondering if you can just talk to some of the ways that Cad Query fits into your flow in conjunction with some of those commercial tools and being able to go back and forth from 1 to the other?
[00:08:04] Unknown:
Cad Query can export to the typical interchange formats that you use from getting from 1 CAD program to another. That's the primary way we share things back and forth. Cad Query can also import from other CAD packages. So you can do this thing where you create something in Blender or in Fusion 360. You export it and then import it into Cadbury and then build the design on top of that. Typically, users it's more common to do that with 2 d because 2 d is fairly cumbersome to do in code. There's a lot of mental overhead in it. And we've made some strides towards making that better. Here recently, we've got a sketch functionality with constraints. So you can say, I want this line to always be at a right angle to this line or connect at this point, that type of thing. So that helps a lot. But there still is a fair amount of middle overhead in certain things like that.
[00:09:01] Unknown:
In terms of the industries or domains in which you're building those models, I'm wondering if there are any kind of common approaches to how you think about building up these maybe asset libraries of, you know, I'm working in a industrial design arena where I'm dealing with a lot of gears, so I'm going to have a model that is a particular gear ratio, and I wanna be able to size that up or down, but the actual structure of the gear is going to remain the same, and I can use that in multiple applications. So I, you know, maybe design that in a commercial CAD package, export that 1 file, and then I can import that for other applications. And then, you know, how that transfers into being able to do the same thing with, like, the module approach to Python modules being able to create that reusable software library. And just some of the ways that you think about kind of the composability and reusability aspect of the investments that you're making in designing these individual kind of components for a broader system?
[00:09:55] Unknown:
Oftentimes when you're creating like a gear or whatever with a graphical CAD package, you create that 1 gear and it's kind of static. That's fine if you just want that 1 gear. But if you need gears of all different sizes, it helps to be able to use something like CAD Query where you can put parameters in. We have extensions to CAD Query that community members have created specifically for gears where you tell it the pitch and, you know, how many teeth, the diameter, and things like that. And it generates it for you. You can have kind of a meta level of software that imports that package and runs through a lot of different parameters, you know, thousands of permutations of those gears and just generates them all for you so that you have a library right there. But most of the time with Cadbury, you would just generate the gear you need on the fly with the exact parameters that you need. That is very helpful, especially with 3 d printing, because you can generate a gear and output it, print it on your 3 d printer, and you've got the exact gear that you need for your project.
[00:10:58] Unknown:
In terms of the overall space of being able to automate the design of these CAD programs and these CAD models, I know that CAD Query isn't the only option available, but I'm wondering if you can just talk to some of the features or capabilities that are unique to it that make it a necessary or a sort of useful entrant into that ecosystem of being able to automate the design of these, you know, 2 d or 3 d models and just some of the ways that it fits into that broader ecosystem?
[00:11:30] Unknown:
There are multiple great options out there that are part of the ecosystem. Cad Query, at its core, uses a boundary representation, Cad Kernel called Open Cascade. And boundary representation defines an object based on its skin, like its outside boundaries, outside faces. A lot of other CAD packages in the space use what is called functional representation, where you build up a more complex object from a bunch of simpler objects, like cylinders and cubes and things, and use mathematical operations on them, such as union and subtract and intersect to make those objects. But most commercial CAD packages use boundary representation, CAD kernels, because of the robustness of the models.
And so I think that's 1 thing that I appreciate about CAD Query. Another is the fact that it uses Python as its language. That we've had quite a few users who actually appreciate that fact because it's a standard language. There's documentation everywhere. And there are a lot of science and engineering packages that you can pull into Cad Query. As far as the design of Cad Query itself, there are certain functions like selectors being 1 of the main things. Selectors are something that can be kind of hard to get your head around when you're used to point and click CAD systems because you're used to saying to just clicking on a face and saying, I want that face right there. But in CAD query, you're giving a a more abstract instruction to say, I always want the maximal face in the z direction.
And so the designs, usually, if you're careful about how you use selectors, you can end up with a design that's very robust and that you can make changes to and do experiments on. And it doesn't doesn't break all the way down like a lot of point and click graphical CAD designs do.
[00:13:28] Unknown:
In terms of the actual implementation of CAD Query, can you dig into some of the project design and some of the ways that you thought about architecting it and the API aspects to make it accessible to people who don't necessarily have a pure Python background and are maybe coming from that mechanical engineering space? Doctor. It can be a real challenge to try and accommodate everybody with COCAD.
[00:13:51] Unknown:
When I say COCAD, I mean programmatic CAD, you know, scripted CAD. I have a tendency to just call it co CAD because it's easier to say. A lot of the terminology that's used in the API actually comes more from a mechanical side of things, I feel like. There can be some abstract things. But you can say rectangle, cube, cylinder, extrude, cut, things like that. Those are things that are pretty common for most people to understand. As far as the implementation of Cad Query, it's built with what we see as a fluent API, where that's part of that whole goal of Cadbury and allowing you to build things in kind of the way you would think about them or intuitively do it. So you can create a work plane that's kind of like your work surface.
And then you call for a rectangle on that surface, and you give it dimensions, and then you call for that to be extruded, and you get a cube.
[00:14:50] Unknown:
It's designed to be hopefully fairly intuitive in that way. In terms of the evolution of the project, I'm wondering if you can talk to some of the ways that the use cases have evolved as the community has grown around it and as your familiarity with the Python ecosystem and the ways that you're applying it to your own work have changed and grown into some of the ways that the initial sort of goals and design elements have shifted to where they are today?
[00:15:17] Unknown:
I feel like the goals have pretty much stayed the same on the project, but how Cadbury is implemented has changed a lot over time. We originally started out built on top of the FreeCAD, FreeCAD's Python API. And FreeCAD is an open source graphical point and click CAD. And so we were built on top of their Python API. But, eventually, we kind of outgrew that. We needed more direct access underneath. And so our project has evolved in that way to where we do more and more ourselves. As far as how the community has used it, it has evolved a lot over time. I feel like users have gotten a lot more sophisticated over time. In the early days of Cadbury, there were a lot of things that it didn't do or didn't do very well. As it's advanced and as we've built and changed our foundation to be able to do more with it, people have pushed it harder and harder.
A lot of times, it amazes me what people come up with. There there are things that I wouldn't have imagined that they could actually accomplish with Cadbury.
[00:16:23] Unknown:
And with some projects, 1 of the motivating factors for driving the evolution of it has to do with the rate of change of the surrounding ecosystem. And I'm curious how that manifests in the space of CAD, whether that's something that actually does have a decent rate of innovation with new ideas or interfaces being introduced, or if it's something that is fairly stable and the evolution of Cadbury is more driven just by the actual usage of it. That's a great point. I feel like Cadbury is mostly driven by the users, the community.
[00:16:56] Unknown:
The CAD ecosystem is fairly stable. Things don't tend to change too much. There are always new ideas coming into the CAD space. But as far as fundamentally changing the way things are done, it's been pretty much the same. Most of the time, it is a community member saying, I'm doing this project. I don't have this functionality and I need it. Or this community member saying, Hey, there's a bug here, and that's preventing me from being able to do something. And that drives most of the development.
[00:17:26] Unknown:
Going back to the question of API design, you know, you mentioned that it's difficult to balance between the domain expertise of software developers and the domain expertise of people coming from mechanical engineering, material sciences, all these kinds of things. And I'm wondering how you thought about the balance of being able to give it this fluent API so it's easy and approachable to, you know, string together kind of the sequence of verbs that you want to do in the model, but also balancing that with the level of kind of domain specific nomenclature for bringing in ideas for material sciences or mechanical engineering as part of the API versus being more kind of plain English to it. So being able to make it accessible to people who don't necessarily come from a specific domain background, but also making it understandable for people who do have that understanding of this is the term that I would use in this situation, but this actually maps cleanly to the kind of semantic elements of the API design as it exists.
[00:18:27] Unknown:
Right. And, yeah, you're always gonna get different people from different backgrounds saying, hey, I would call this this or I would call this that. Cadbury has multiple layers. There's kind of a layer below the fluent layer that's a little bit more abstract, but we try to keep the interface fairly straightforward. Although our API design process is really fairly loose and fairly organic. We're a small team like a lot of open source projects. A lot of it gets discussed on Discord or GitHub these days. In the early days, there wasn't a large community, so a lot of decisions had to be made unilaterally.
But now a lot of times it's discussed. And if somebody says, Hey, that terminology or that what you're proposing just doesn't make sense, you know, then we can discuss that. It's nice to have a larger community of people with differing backgrounds to be able to say that. You know, to say that I think what you're doing here might cause some confusion in these industries.
[00:19:25] Unknown:
I'm curious if there's room in the way that the package is implemented to be able to add maybe domain specific plug ins, to be able to say that we're actually just going to map on top of that underlying mechanic of this this is the actual core semantics of what the package is doing, but we can give you a way to extend the interface at the literate level to be able to say, this is actually the term that I want to have mapped into here. And so then you can have an extension module that plugs in for people coming from mechanical engineering or people coming from architectural design so that the specific operations all map to the same thing, but the terms that are used in that fluent API are actually more specific to a specific industry.
[00:20:06] Unknown:
We don't have any specific examples of a domain specific I mean, we have had people build on top of Cad Query with all sorts of different projects. And the way Cad Query is implemented, you have that Cad kernel on the bottom level. That's the foundational kernel that does all the math and the geometry generation for you. And then we have that middle level, which is our bindings, our custom bindings to that cad kernel. And so we've got some projects that will just take that middle level. They'll pull that in, and they will build on top of that. And then we also have the ability to accept plug ins and extensions that basically just they either can either replace, although that's discouraged, or add to Cadbury's existing functionality.
So there is that potential to add domain specific nomenclature. But usually, it's used just to add new functionality. You know, things like finger joints and automatically finding the sizes of a radius of a fillet and things like that.
[00:21:09] Unknown:
In terms of the workflow of somebody who is using CAD Query to build up a model or a set of models, I'm wondering if you can just talk through the overall process of going from, I have a particular application that I want to design for and then moving through to I have a finished design. I'm going to output this to some specific export format so that I can download that into a 3 d printer or send it to a manufacturer for being able to actually construct these, you know, widgets or whatever it is that you're building?
[00:21:36] Unknown:
There's a few different approaches people take. If they've got something that already exists in the world that they have to build around or that they want to replicate, they'll start by sitting down and measuring that with a scalar pair of calipers. And then with the boundary representation CAD kernel, it's a lot of processes of drawing 2 d and applying a 3 d operation into that to move it into the 3 d space. You know, you create that cube in 3 d, and then you say, okay, on this space, I want a counterbore hole that goes all the way through. And so it's that iterative process of building up to that that takes many different forms and has all sorts of different layers of complexity, all the way up to people building jet engine turbines with Cadbury and things like that. And so once you have that object, you've iterated on it, and you've spent time thinking about the parameters that you wanted to have. So 1 of the most important things about category is you define parameters as Python variables.
And then you work those parameters into your design throughout so that you're not going in and changing the code. You're just changing that 1 variable. And you can go from having a circular profile on the outside of an object to having a square profile or something like that. You can make very big changes very quickly by changing the parameters. So once a user finishes, Cadbury has import and export functionality built into it. And so you can export to STEP files for CNC machines, STL for 3 d printers. We can export to DXF and SVG for things like laser cutters and vinyl cutters and things like that. So it just depends on how the thing needs to be manufactured.
We also have community members that are working on things like direct CNC output plugins for Cad Query to where you don't even have to go to the intermediate format. You can just go straight to the g code for the router or the printer or whatever.
[00:23:42] Unknown:
Need to automate your Python code in the cloud? Want to avoid the hassle of setting up and maintaining infrastructure? Shipyard is the premier orchestration platform built to help you quickly launch, monitor, and share Python workflows in a matter of minutes with 0 changes to your code. Shipyard provides powerful features like webhooks, error handling, monitoring, automatic containerization, syncing with GitHub, and more. Plus, it comes with over 70 open source low code templates to help you quickly build solutions with the tools you already use. Go to pythonpodcast.com/shipyard today to get started automating with a free developer plan.
1 of the opportunities that comes in because of the fact that you're doing all this in pure software is the ability to add in things like tests. Or as you mentioned, there's this broad ecosystem of libraries in Python for scientific or industry related domains. So being able to maybe do some kind of, you know, optimization solver for being able to say, I want to use, you know, this combination of gears to be able to generate this amount of force at the output. And so I can then plug in a library that gives me some of those computations to be able to understand, okay, what are the relative sizes of these gears that I want to put together and, you know, start from 1 gear and then generate the output of multiple gears working in tandem? And then also the concept of being able to bring in things like unit testing to say, I have this component. I want to ensure that this gear will mesh properly with this other gear that I have here, and I want that to always be true. So before I generate the final output, I want to apply this set of unit and integration tests, some of the ways that you've seen things like that being incorporated into people's workflows of building with Cadbury.
[00:25:21] Unknown:
You'll see every once in a while on, discord or groups for Cad Query, you'll see somebody remind the person asking the question that it's just Python. Like, you've got the whole world of Python open to you with Cad Query. 1 thing that I'm interested in and have started experimenting with is using continuous integration systems, like on GitHub and GitLab. So you push your category model or the assembly to GitHub, and it automatically runs tests to make sure there's no interference on your assembly, that the part can be sliced and 3 d printed properly, and things like that. And I think that there's so many different ways you can do it and so many different things you can do. I I think it's wide open. But your example of optimizing gears or optimizing any design, really, is something that is of interest to me. I don't see people doing that as much yet.
There are a few cases, but I'd like to see a lot more of that where you pull in a module or library and use it to run tests on your design. And then your code automatically adjusts parameters and then try it again. And you could do that iterative process. There's ways to use like evolutionary algorithms, maybe even with a person in the loop to say, okay, that's headed in the right direction. Continue on that. So I think, yeah, there's a lot of room for design optimization, and I hope to see that more and more as the project gets older and matures more.
[00:26:50] Unknown:
In the space of the more commercial packages and the, you know, point and click style design of these CAD models, I'm wondering if you have seen any elements of actual testing of verifying that the model that's being created is actually going to fit the use case or the parameters that it's being designed for.
[00:27:10] Unknown:
I'm not super familiar with commercial graphical CAD anymore just because I don't use it very much anymore. Earlier in my career, I used it a lot more. But, yeah, there are design checks. There are checks kind of like what KiCad does with circuit boards where we go through and check some obvious things. There are also usually, these commercial CAD packages will have some type of programming interface for automation and some flexibility. And so you will see sometimes that people will create their own checks through those types of interfaces on designs.
[00:27:46] Unknown:
You mentioned that Cad Query is something that you're using for your own day to day work. I'm wondering if you can just talk to some of the ways that it fits into your workflow. And if you're able to, some of the actual outputs that you've been able to generate from it.
[00:28:01] Unknown:
1 project going on there right now that is a push button switch for assistive technology use. So someone who lacks fine motor control with their hands and arms can use a push button switch like this to actually control a computer using screen scanning software. So it'll scan across quadrants of the screen and you hit the button and then it'll 0 on that quadrant. You can drill down. And so during the pandemic, what happened was a lot of places were saying that you have to have a separate switch for each person because they didn't want them transmitting COVID by touching the switch and then handing it to someone else.
And so I've used Cad Query to design a customizable switch that can then be 3 d printed. And with Cad Query, you can do things like change the diameter and have everything adjust so you can have a bigger or smaller switch. You can change the outside shape of it. You know, if you have a child that wants to have a star shape or something like that, you could do that type of thing. So that's 1 place where I use Cadbury in my workflow now. Usually the workflow with me is that I've actually created a software package called Symblage that allows you to do more point and click work with models. So you're generating the geometry with mouse interaction, but it generates CAD Query code on the background. So it's kind of a shortcut.
For me, coming from a mechanical engineering background, it's my way of trying to get the best of both worlds. And so a lot of times what I'll do is I will use Symblage to generate category code, and then I'll import that into another set of code and run tests on it or export it to different formats and do what I need to do with it from there. But I have a 3 d printer and a small CNC router, and there are plenty of things that I put through those, I output to STEP and STL from Cadbury with.
[00:30:00] Unknown:
We hinted at it earlier, but there are also a couple of other packages that wrap CAD Query to be able to give a visual There are
[00:30:17] Unknown:
There are a couple of packages that are designed to be basically IDEs for Cadbury. There's 1 called CQ Editor, which is kind of our community's standard IDE that most people use, and that's PyQt or PySide based. And so you enter your code in a code pane and you press the render key or click the button and it generates your 3 d model on the other side. And it has debugging tools that allow you to step through the objects and things like that. There's also Jupyter CAD Query, which uses Jupyter Notebooks with CAD Query integrated into it. And so that's a web based solution that'll run on MyBinder. And and a lot of people who are in the scientific field are used to using Jupyter Notebooks. And so they can integrate their 3 d CAD models into that.
There are multiple other projects, but those are the 2 main graphical IDEs that we have.
[00:31:17] Unknown:
In terms of the ways that CAD Query is being used, what are some of the most interesting or innovative or unexpected ways that you've seen it applied?
[00:31:26] Unknown:
Doctor. A few of the innovative ways that we've seen CAD Query used. There are lots of them, but 1 would be that there was a Cadcware user who wanted to create 3 d models of brain scans. And then what they would do is they would 3 d print those models and fill them with water. And then they would use those to test MRI machines. So they had channels in them and they would fill with water, and the MRI machine would kind of treat that somewhat like an actual human brain for testing. And so that was a pretty ingenious and probably somewhat difficult way to use Cadbury and 3 d printing to accomplish a goal.
We also had a team from the UK Atomic Energy Authority that used Cadbury to create a generator for fusion reactors. And they even had a website where you could go and you could input different aspects or different parameters of the reactor, and it would generate like the reactor chamber on the fly. There's also a company called FX Bricks. They're a member of the community and have contributed an extension to Cadbury called CQ Kit. But they use Cadbury to create LEGO compatible parts for model railroad sets. So it'll have the metal rails on top, but might have wings sticking out with LEGO knurls or nubs on the side that you can then build things onto.
There are many more examples, but those are a few of the ones that come to mind. That's really cool. And
[00:32:59] Unknown:
in terms of your experience of maintaining and evolving the Cadbury package and using it for your own work, what are some of the interesting or unexpected or challenging lessons that you've learned in the process?
[00:33:10] Unknown:
Doctor. There are so many things that I've learned while being involved with CAD Query, but I think for me, 1 of the bigger lessons was that even in a project like Cad Query that tends to draw on a lot of developers, if something is too hard to install, it definitely holds a project back. And so like in the early days, we just had the Cad Query library. Most of the time, you just had to export whatever you were creating. You'd type your code in an editor. You would run it on the command line. You would export that to a format that you could view in something else, or you had to jump through some extra hoops to be able to view it in FreeCAD. And eventually, I created a FreeCAD workbench that was easy to install and use that works a lot like a simple version of CQ Editor that we were talking about a minute ago. And so you could enter your code in a code editor and then hit a button and it generated your model. And we saw a big jump in users after the release of that work. That was the first moment where we really saw a jump in users. And it was a batteries For people
[00:34:30] Unknown:
who are interested For people who are interested in digging into CAD or who are already using CAD, but they want to be able to automate more of their usage of it, what are the cases where CAD Query is the wrong choice and they might be better suited just using the programmatic interface for some of those commercial projects or using 1 of these other libraries or frameworks for being able to generate the models programmatically.
[00:34:52] Unknown:
There are times when you want to create something very quickly and it's gonna be a 1 off. You're only gonna make 1 of it. You don't care if it's parametric. You don't care if you can adjust it or anything, where a graphical CAD system that's mouse driven can be really useful. You click, you do a few things, and you're done. And, also, there are other aspects of Cadbury, like the fact that it's built on a boundary representation kernel. We talked about that in opposition to a functional representation, CAG kernel. Functional representation, CAG kernels, do certain things better than boundary representation kernels. For example, we recently had a user that wanted to take the pixels from an SLA 3 d printer. So they basically have a screen, and the UV light cures the resin. And then that's moved through to create layers. And so they wanted to take those pixels, 800 by 800, and build those up layer by layer into voxels, which are just 3 d pixels. And there were maybe, you know, I don't know how many they had. It was well over a1000000 of those voxels. And they were trying to manipulate them and, you know, union them together and things like that. There are times when the CAG kernel, the CAG query is built on, it just is not designed for that. You know, CAG kernel, there are other tools that are better for that.
And there can be personal reasons why OCAD isn't for people too. I mean, some people feel like they never get over the mental friction of trying to think and code to get an object out on their screen. Some people, it never clicks with them, or they just don't think that way. I can certainly sympathize with those users as using CAD, you know, commercial graphical CAD for years years. I understand that it would be frustrating to have that kind of layer of abstraction to go through code to get out to the thing you want. But a lot of users that we have that they have a hard time with CAD Query for various reasons. They're not programmers or that the mental model doesn't fit. But we have a lot of times people will say, you know, I had a really hard time with it, but I pushed through and it finally clicked.
And now it's a tool I wouldn't wanna be without.
[00:37:14] Unknown:
As you continue to use and maintain the cab query package, what are some of the things you have planned for the near to medium term or any particular areas of exploration that you're excited to dig into, or ways that you're excited to apply it to your own work? Well, I think on a community level,
[00:37:32] Unknown:
Cadbury has recently added the 3 d assembly capability along with the 2 d sketching. I think the community is really starting to kind of feel out the edges of that and find ways they can use it and expand it further. We're also in the process of kind of giving it the shakedown run where, you know, we figure out what works and what doesn't. Here recently, the assembly solver was refactored because it wasn't quite performing how we wanted it to. And so there's a lot of that in the near to midterm that I think the community will start using it more and will find things that need to be done.
On a personal level, I'm excited about Symblage and the idea of kind of bridging the graphical and code world to try and get the best of both worlds. That approach isn't for everybody. Some people would rather it just be pure code and others would want the mouse driven CAD. But for me, in the background I come from, it's a very attractive option for me to have the GUI take some of that mental overhead off of me, but still retain the power of co CAD in the background. We talked about continuous integration systems and also optimization designs and things like that. I think that's an area I'd like to explore more. I've kind of taken some tentative steps in that direction, and I hope to push that way more. And it would not surprise me at all if the community starts picking that up and doing some really interesting things with it. That's usually the way it happens is you'll have somebody report in on Discord or Google Groups and say, hey, yeah, I did this thing, you know, and you upload it. It does, you know, all these amazing things. And then other people see that and inspires them. They take bits and pieces of it and reuse it for their own uses. So that's an area I'm personally am really interested in. But there's so much happening in Cadbury and in the community and in the ecosystem that it can be hard to keep up sometimes. And there's a lot of really interesting things to see and do.
[00:39:42] Unknown:
Are there any other aspects of the Cadbury project or the ways that you're using it or the community and ecosystem around it that we didn't discuss yet that you'd like to cover before we close
[00:39:52] Unknown:
out the show? I think that we have kind of a growing ecosystem of extensions in Cadbury. 1 of the discussions we're having currently is kind of where is that line between the core of Cad Query and what needs to go in an extension? Because it can be very easy to to start just pulling features in. And before you know it, things are more unmanageable and things are bloated. And so a lot of our discussion is on, you know, where is that line, and how do we support people creating these extensions so that they don't feel like, you know, they're left out to where the extensions can be 1st class citizens. So that's 1 thing we're very interested in exploring. And I think we have multiple great extensions like CQ Warehouse is 1. CQ Kit is another. And there are a few others. But especially CQ Warehouse has been growing very fast. New features put in it. Things like finger joint boxes and key set inserts for 3 d printed parts and threads and a lot of features that you don't necessarily feel that you could put in category, but that you want to have in the category ecosystem. And so I think extensions
[00:41:04] Unknown:
are a way we want to head in the future, supporting them and integrating them and helping people find the extensions that they want and need. Yeah. It's definitely always an interesting challenge as a project grows and starts to expand beyond the bounds of what the core can maintain and being able to, you know, make that discoverability aspect easy and natural while still being able to maintain some measure of kind of curation and quality signals so that people can understand which parts are ready for use and which ones are still kind of in development or maybe have been abandoned because the original author doesn't use it anymore.
[00:41:39] Unknown:
Right. It's tough because everybody has their own idea of what a lean core versus, you know, the extension ecosystem looks like. And you do have that situation where a project will go like crazy for a while being heavily maintained, you know, extension, and then it gets dropped. And so we've had that situation before a few times. It's, yeah, it's a constant adjustment and a constant balancing act because we want people to see the value in category and to be able to use it for what they want. And so it's natural to say, Oh yeah, we'll just add that into core. We'll add that into core. Whereas, you know, you kind of have to sometimes step back and have a discussion about, you know, what goes in and what's left out. But like I said, at the same time, you don't want to extinguish that excitement that people have for that interest to add functionality.
And so that's where I think we have to also support people who are creating extensions as well.
[00:42:40] Unknown:
Alright. Well, for anybody who wants to get in touch with you and follow along with the work that you're doing or get involved with the Cadbury community, I'll have you add your preferred contact information to the show notes. And so with that, I'll move us into the picks. This week, I'm going to choose the newest Doctor Strange movie in the multiverse of madness. Watched that recently, and it was a very interesting and fun movie. There were a few scenes that I thought were very clever. There's 1 part where he's battling a version of himself using musical notes and scales, and the way that they just managed the soundtrack through all that was really cool. So definitely recommend checking that out if you're at all into any of the Marvel or superhero movies. With that, I'll pass it to you, Jeremy. Do you have any picks this week? Yeah. I think I've watched the first 4 episodes of Star Trek Strange New Worlds. It's the latest Star Trek
[00:43:28] Unknown:
series, and it's kind of a a little bit of a throwback to the original series back in the sixties for anyone who's familiar with that. I've really enjoyed it. I was a big fan of the original series and Star Trek The Next Generation and really appreciated a lot of the hopeful number of the different Star Trek series, like Next Generation,
[00:43:52] Unknown:
because I used to watch a number of the different Star Trek series, like Next Generation, Deep Space 9, but it's been a while since I've spent much time on that ecosystem. So definitely appreciate you taking the time today to join me and share the work that you're doing on Cad Query and some of the ways that it's being used and applied and how people can use that to help make real things in the world. So I appreciate all of the time and energy that you and the community are putting into that, and I hope you enjoy the rest of your day. Thank you very much for having me on. I appreciate it.
[00:44:22] Unknown:
Thank you for listening. Don't forget to check out our other shows, the Data Engineering Podcast, which covers the latest on modern data management, and the Machine Learning Podcast, which helps you go from idea to production with machine learning. Visit the site at pythonpodcast.com to subscribe to the show, sign up for the mailing list, and read the show notes. And if you learned something or tried out a project from the show, then tell us about it. Email hosts@pythonpodcast.com with your story. And to help other people find the show, please leave a review on Apple Podcasts and tell your friends and coworkers.
Introduction and Sponsor Messages
Interview with Jeremy Wright Begins
Jeremy Wright's Introduction to Python
Overview of CAD and Its Applications
Introduction to CAD Query
Jeremy's Motivation and Community Involvement
Integration with Commercial CAD Tools
Reusable Components and Libraries in CAD Query
Unique Features of CAD Query
Project Design and API Accessibility
Evolution of CAD Query and Community Use Cases
Balancing API Design for Different Domains
Domain-Specific Extensions and Plugins
Workflow and Exporting Models
Automation and Testing in CAD Query
Commercial CAD Packages and Testing
Jeremy's Personal Projects Using CAD Query
Graphical IDEs for CAD Query
Innovative Uses of CAD Query
Lessons Learned from Maintaining CAD Query
When CAD Query Might Not Be the Right Choice
Future Plans and Areas of Exploration
Growing Ecosystem of Extensions
Closing Remarks and Picks