Skip to content

Instantly share code, notes, and snippets.

@paulharter
Last active March 8, 2016 14:47
Show Gist options
  • Save paulharter/05cd88d659fddcdb5447 to your computer and use it in GitHub Desktop.
Save paulharter/05cd88d659fddcdb5447 to your computer and use it in GitHub Desktop.
Multiple real thickness filesets

Multiple real thicknesses

Situation

If we model a range of real thicknesses for each different material type, or even for each different sheet,we end up with quite a few CAD files.

We have to create a full set of CAD files for every possible combination of thicknesses. For 11 thicknesses and 2 different materials ths is 11^2 which is 121 sets of CAD files. If we never needed to model more than 2 different real thicknesses this might be manageable within a single fileset, but the options and choosing them is still harder to manage. If we go to 3 for even 4 thicknesses the quantity of filesets balloons 11^4 is 14,641.

The plan

The plan is to create individual filesets for each combination, which could potentially be created on demand. This way the options for real thickness would use all the existing mechanisms in winnow options rather than special casing them.

The set of possible thicknesses needs to include nested options for imperial and metric units.

The description of all possible thickness combinations should be given in the product options something like this:

{
    "options": {
        "thicknesses": {
            "scopes": [
                "maker"
            ], 
            "name": "units", 
            "default": "mm", 
            "values": [
                {
                    "options": {
                        "birch_real_thickness": {
                            "start": 17.5, 
                            "step": 0.1, 
                            "name": "Birch ply thickness", 
                            "min": 17.5, 
                            "default": 18.0, 
                            "max": 18.5, 
                            "type": "numeric::step", 
                            "description": "The actual thickness of all sheets of birch ply used in the table in mm"
                        }, 
                        "wisa_real_thickness": {
                            "start": 17.5, 
                            "step": 0.1, 
                            "name": "Wisa thickness", 
                            "min": 17.5, 
                            "default": 18.0, 
                            "max": 18.5, 
                            "type": "numeric::step", 
                            "description": "The actual thickness of all sheets of Wisa used in the table in mm"
                        }
                    }, 
                    "type": "string", 
                    "name": "mm", 
                    "value": "mm", 
                    "description": "Millimetres"
                }, 
                {
                    "options": {
                        "birch_real_thickness": {
                            "name": "Birch ply thickness",
                            "description": "The actual thickness of all sheets of birch ply used in the table in inches", 
                            "min": 0.67, 
                            "default": 0.75, 
                            "max": 0.775, 
                            "start": 0.67, 
                            "step": 0.005, 
                            "type": "numeric::step"
                        }, 
                        "wisa_real_thickness": {
                            "name": "Wisa thickness", 
                            "description": "The actual thickness of all sheets of Wisa used in the table in inches", 
                            "min": 0.67, 
                            "default": 0.75, 
                            "max": 0.775, 
                            "start": 0.67, 
                            "step": 0.005, 
                            "type": "numeric::step"
                        }
                    }, 
                    "type": "string", 
                    "name": "Inches", 
                    "value": "inches", 
                    "description": "Inches"
                }
            ], 
            "type": "set::string", 
            "description": "Please choose a unit of measurement"
        }
    }, 
    "name": "table", 
    "description": "A nice table"
}

And the options in every fileset should describe which thicknesses its files are for :

{
    "name": "best files", 
    "options": {
        "thicknesses": {
            "type": "string", 
            "options": {
                "birch_real_thickness": 17.9, 
                "wisa_real_thickness": 18.2
            }, 
            "value": "mm"
        }
    }
}

The names birch_real_thickness and wisa_real_thickness are just identifiers to make the lookup of filesets work. There is no need for them to be used within the fileset to reference the values, the filest should contain this information anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment