Faces by name in the face commands; model.faces gives a point on each face (#1243)
This commit is contained in:
1 parent
2cab09f65b
commit
5c6f70cc00
17 files changed
+480
-29
No files matched your search
@@ -88,6 +88,16 @@ geometry, as it does for a face: it does not take whichever edge is nearest now.
|
||||
without a name, by a build that kept only the point, is found by the edge nearest its point, as
|
||||
it always was, and takes that edge's name when its sketch is next edited.
|
||||
|
||||
A command that takes a face as a point can be given a name `model.faces` lists instead
|
||||
(`face.delete`, `solid.shell`, `solid.draft`, `solid.offset_face`, `solid.split_face`, the `faces`
|
||||
of `solid.replace_face`, the `face` of `sheet.convert`). It is found with the same lookup
|
||||
(`naming::locate_one`: the face with that name, or the one face answering to it, on the given
|
||||
body or any body; a name that finds several faces is refused). The command takes a point on that
|
||||
face (`naming::named_face_point`: the incentre of the face's roomiest triangle, moved onto the
|
||||
surface of a plane, cylinder, cone, sphere or torus), which the feature stores like a picked one,
|
||||
with the name it then gets as before. Nothing new is stored in the design. `model.faces` lists
|
||||
that point for every face.
|
||||
|
||||
A hole placed by a position on a face is the exception to "the point nearest the reference's
|
||||
point": its position is a place, not a pick. The hole follows its face along its own axis, so it
|
||||
moves with the face when the face moves, and when the face no longer reaches the position it stays
|
||||
|
||||
@@ -155,6 +155,16 @@ still be added through `set`. The fields of the common features:
|
||||
|
||||
For any other feature, `timeline.inspect` shows the fields.
|
||||
|
||||
Where a command takes a face as a point (`face.delete`, `solid.shell`, `solid.draft`,
|
||||
`solid.offset_face`, `solid.split_face`, the `faces` of `solid.replace_face`, and the `face` of
|
||||
`sheet.convert`), a script can give the face's name instead, as `model.faces` lists it:
|
||||
`{"command": "face.delete", "params": {"faces": ["F2:side#1", "F2:side#2"], "body": "Plate"}}`.
|
||||
`model.faces` also lists a `point` on each face that picks it (the centroid of a face with a hole
|
||||
in it is in the hole, that of a half cylinder inside the cylinder) and, for a cylindrical face,
|
||||
its `cylinder`: `origin` and `axis` of its axis, and `radius`. A name that is more than one face
|
||||
(the pieces of a split face, or one face of several bodies) is refused; `body` says which body to
|
||||
look on.
|
||||
|
||||
Press **Delete** on anything selected (bodies, faces, sketches, features, planes, components,
|
||||
canvases). It runs as one undoable step and lists the features that would go with it or fail.
|
||||
|
||||
|
||||
@@ -143,6 +143,10 @@ and bends that close a ring.
|
||||
"bends":[[50,0,0],[100,30,0],[50,60,0],[0,30,0]]}}
|
||||
```
|
||||
|
||||
The `face` can also be the name `model.faces` lists for it (`"face":"F1:+z"`), which saves
|
||||
computing a point on a face with holes or a curved outline: `model.faces` gives every face a
|
||||
`point` that lies on it.
|
||||
|
||||
For a shop drawing or spreadsheet, `sheet.export_bend_table` returns CSV by default; choose
|
||||
`format: "json"` for structured data. It includes the sheet rule, thickness, bend angles,
|
||||
radii, allowances and flat centre-line coordinates. Lengths use millimetres and angles use
|
||||
|
||||
+1
-1
@@ -131,7 +131,7 @@ They cover the workflow, the command shapes, how to verify with `measure`, and t
|
||||
| `batch` | `commands: [{command, params}]`, `rollback?` (default true), `verbose?` (default true) | Run steps in order, stop at the first error and undo the completed steps. The reply names the failing step (`failed.index`, `failed.command`, `failed.error`) and every result before it. `verbose: false` keeps the reply small in large designs: feature steps leave out the full body list (`created_bodies`, `changed_bodies`, `removed_bodies` stay) and sketch steps the ids they repeat outside `created`. Bridged to an app that has `engine.batch`, the whole batch is one control request (one frame of the app). Older apps, and apps showing the agent cursor, get the steps one by one. |
|
||||
| `inspect_design` | `measure?` (default true), `sketches?` (default true) | Design properties (`metadata`: project, author… and other tools' keys; set them with `execute` `document.metadata.set`), parameters, timeline (type, suppressed, rolled back, error, warning, timing), bodies (volume, area, centre of mass, bbox, face/edge/vertex counts, visible), sketches (curves, points, constraints, profiles, DOF, solve status, visible), selection, undo depth. Hide helper sketches, bodies or construction planes with `execute` `browser.visibility` (`{items, visible}` or `{folder, visible}`), and joint glyphs with `{joints: [id or name], visible}` or `{folder: "joints", visible}` (a hidden joint still constrains and drives; `joint.list` reports each joint's `visible`). |
|
||||
| `measure` | `body?` | Volume (mm³), area (mm²), centre of mass, bbox and topology counts per body, with totals. |
|
||||
| `body_topology` | `body` | Edges (index, midpoint, length, ends) and faces (index, area, centroid, normal). An edge midpoint is the `[x,y,z]` that picks that edge for fillet and chamfer. |
|
||||
| `body_topology` | `body` | Edges (index, midpoint, length, ends) and faces (index, name, area, centroid, normal, `point`, and for a cylindrical face its `cylinder`: `origin`, `axis`, `radius`). An edge midpoint is the `[x,y,z]` that picks that edge for fillet and chamfer. A face's `point` lies on it and picks it (its centroid may not: that of a face with a hole is in the hole); a face's `name` picks it for the commands that take faces (`face.delete`, `solid.shell`, `solid.draft`, `solid.offset_face`, `solid.split_face`, `solid.replace_face`, and `face` of `sheet.convert`). |
|
||||
| `set_parameter` | `name`, `value` (number or expression), `unit?`, `comment?` | Create or change a user parameter and recompute; reports `recomputed` (features rebuilt), `restored` (features whose earlier result for the same inputs was reused, e.g. a value set back) and features that now fail. |
|
||||
| `screenshot` | `view?` (iso, top, front, back, bottom, left, right, home, fit, or a named view saved with `view.save`), `camera?` (`{target, yaw, pitch, distance, fov?}`, as `view.apply`), `path?`, `width?`, `height?`, `source?` (window, model) | A PNG image content block. Headless: CPU render fitted to the model, or from the named view or camera. Bridged: the app window (default) or a model render with the app's camera; a named view or camera moves the app's viewport there first (`execute` `view.apply` does the same without a screenshot). |
|
||||
| `export` | `path`, `format?` (step, 3mf, 3mf-tagged, stl, stla, obj, urdf), `bodies?`, `mesh_prefix?`, `effort?`, `velocity?` | STEP, 3MF or mesh export; URDF writes the whole assembly with its meshes next to it (`docs/urdf.md`). |
|
||||
|
||||
Reference in new issue
Block a user