roipoussiere / cadquery-server

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

`cq_showcase.yml` specification #46

Open roipoussiere opened 1 year ago

roipoussiere commented 1 year ago

A file containing CadQuery project metada could be used by external tools to render a showcase, used to both define model parameters and predefined samples.

This file must be stored in the same folder of the python modules generating the model and will be typically named cad_showcase.yml. Several showcase files can eventually be present in a single repository, for a better project architecture.

This is intended to be language agnostic and could be used by external service.

Showcase file proposal sample:

title: Roipoussiere's CadQuery parts
version: 0.1.2
description: ...
engine: CadQuery
extension: build123d
license: MIT
author: Roipoussiere <http://...>
repository: http://framagit.com/...
build: main:build # <branch>:<folder>
source: main:src
thumbnail: images/parts.png
export_formats: [ 'stl' ]
models:
  - module: box
    title: Box
    parameters:
      - var: width
        title: Box width
        min: 2
        max: 10
        step: 0.5
    samples:
      - title: Small box
        parameters:
          width: 2
      - title: Medium box
        parameters:
          width: 5
      - title: Big box
        parameters:
          width: 10

  - module: washer
    title: Washer
    parameters:
      - var: inner_diam
        title: Inner diameter
        min: 1
        max: 10
      - var: outer_diam
        title: Outer diameter
        min: 2
        max: 20
    samples:
      - title: M2
        parameters:
          inner_diam: 2.1
          outer_diam: 6
      - title: M3
        parameters:
          inner_diam: 3.1
          outer_diam: 10
      - title: M4
        parameters:
          inner_diam: 4.1
          outer_diam: 14

cq-server could support this file in some way.