Controls to adjust the style of a generated 3D model.
| 3 | |
| 4 | |
| 5 | class ModelControls(BaseModel): |
| 6 | ''' Controls to adjust the style of a generated 3D model. ''' |
| 7 | stl_filename: Optional[str] = '3d_model' |
| 8 | include_date: Optional[bool] = True |
| 9 | tube_shape: Optional[str] = 'rectangle' # 'rectangle'/'diamond'/'hexagon'/'octagon' |
| 10 | tube_type: Optional[str] = 'flow' # 'flow'/'cylinders' |
| 11 | stl_type: Optional[str] = 'ascii' # 'binary'/'ascii' |
| 12 | stls_combined: Optional[bool] = True |
| 13 | # initialization_data is information about initial printing conditions, which may be |
| 14 | # changed by the fullcontrol 'design', whereas the above attributes are never changed |
| 15 | # by the 'design'. |
| 16 | # Values passed for initialization_data overwrite the default initialization data of |
| 17 | # the printer. |
| 18 | initialization_data: Optional[dict] = {} |
| 19 | |
| 20 | def shape_properties(self): |
| 21 | return { |
| 22 | 'rectangle': (4, 0, True), |
| 23 | 'diamond': (4, 1, False), |
| 24 | 'hexagon': (6, 0.4, False), |
| 25 | 'octagon': (8, 0.4, True), |
| 26 | }[self.tube_shape] |