{ // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. // Placeholders with the same ids are connected. // Example: "build123d-OCP": { "isFileTemplate": true, "scope": "python", "prefix": "build123d template", "body": [ "# %%", "from build123d import *", "from ocp_vscode import *", "set_port(3939)", "set_defaults(reset_camera=Camera.CENTER,ortho=True)", "densa = 7800/1e6 #carbon steel density g/mm^3", "densb = 2700/1e6 #aluminum alloy", "densc = 1020/1e6 #ABS", "ms = Mode.SUBTRACT", "LMH, LMV = LengthMode.HORIZONTAL, LengthMode.VERTICAL", "# %%", "", "", "", "", "", "", "classes = (BuildPart, BuildSketch, BuildLine) #for OCP-vscode", "set_colormap(ColorMap.seeded(colormap=\"rgb\",alpha=1,seed_value=\"vscod\"))", "show(*[v for v in locals().values() if isinstance(v, classes)],", " #,", " )", "print()", "#print(f\"part mass = {p.part.volume*densa}\")", ], "description": "build123d python template" }, "BuildPart": { "scope": "python", "prefix": "_bdp", "body": [ "with BuildPart() as p:", " $0" ] }, "BuildSketch": { "scope": "python", "prefix": "_bds", "body": [ "with BuildSketch() as s:", " $0" ] }, "BuildLine": { "scope": "python", "prefix": "_bdl", "body": [ "with BuildLine() as l:", " $0" ] }, "Locations": { "scope": "python", "prefix": "_loc", "body": [ "with Locations($0):", " " ] }, "PolarLocations": { "scope": "python", "prefix": "_ploc", "body": [ "with PolarLocations($0):", " " ] }, "GridLocations": { "scope": "python", "prefix": "_gloc", "body": [ "with GridLocations($0):", " " ] }, "AlignCenter": { "scope": "python", "prefix": "_ac", "body": [ "align=(Align.CENTER,Align.CENTER)$0", ] }, "Extrude": { "scope": "python", "prefix": "_ext", "body": [ "extrude(amount=$0)", ] }, "Offset": { "scope": "python", "prefix": "_off", "body": [ "offset(amount=$0)", ] }, } // "from IPython.core.display import HTML", // "HTML(\"\")", // "# %%", // "with BuildPart() as p:", // " with BuildSketch() as s:", // " with BuildLine() as l:",