roipoussiere / cadquery-server

A web server used to render 3d models from CadQuery code loaded dynamically.
MIT License
57 stars 17 forks source link

consider supporting cqgi #44

Closed roipoussiere closed 2 years ago

roipoussiere commented 2 years ago

See CadQuery Gateway Interface documentation and cqgi python script.

Basically it could be a python script on the user project used to build the models and the ui inputs.

dcowden commented 2 years ago

cqgi unit tests are here: https://github.com/CadQuery/cadquery/blob/master/tests/test_cqgi.py

I think an update to cqgi is needed to allow scripts to provide type hints, and infer typing from those.

One example that was mentioned as a requirement is a value with min, max, and step values. Step values are not currently supported by CQGI, but would be implemented by creating a subclass of InputParameter, and overriding set_value to raise an error if the value is not in the step

dcowden commented 2 years ago

BTW, PRs on cqgi would be very welcome to bring it into the modern age. For most cases, a script containing

import typing
diameter: Int = 3

should work when we want to declare only the variable type

roipoussiere commented 2 years ago

fixed in 09b0360 and 91bf79d