Upgrading from Machinome 0.8 to 0.9
Machinome 0.9 brings the packages that grew beside the framework into its
repository and its release, and moves the ones that had addresses of their
own under machinome, without aliases: a former spelling fails where it
is used, naming what to write instead. These are the moves a 0.8 project
makes, and what to change for each. A project’s machines, tests and exports
are otherwise unchanged: exports keep document versions 1 to 13, and a 0.8
viewer reads a 0.9 export.
Install the extra of every node type you use. A bare
pip install machinomecarries no node type:StlNodeandJScadNode, which came with the framework in 0.8, needmachinome[stl]andmachinome[jscad], and without them the import names the line that installs them. Install lists every extra.Import the helpers and the viewer from their addresses.
machinome_mechanicsismachinome.mechanicsandmachinome_viewerismachinome.viewer.web; names, signatures and formulas are unchanged, and no module of a former name is installed. A script that ranpython -m machinome_viewerrunsmachinome viewer.Install every package at the framework’s release. Each extra installs the package of Machinome’s own release,
mechanicsamong them:machinome-mechanics, 0.1.0 until now, is numbered with the framework, so a project that pinned it drops the pin and names themechanicsextra.pip install --upgrade "machinome[...]"with your extras moves the set together.Name the viewer of a still with
--viewer.--rendereris refused, naming--viewer, and the OpenSCAD viewer is installed bymachinome[viewer-openscad],[openscad]or[solid2]; see The viewer flag.Run the commands of
machinome.machinome-viewer describe,serveandcapturearemachinome viewer describe,serveandcapture(The viewer’s command), and the entry pointmachinome.vieweris gone: a host readsmachinome viewer.Run the studio and the films through
machinomeif you ran them from their repositories. Themachinome-studiocommand ismachinome studio, with the same options and configuration file, and the studio’s packagefloorismachinome.studio(machinome studio); the videomaker ismachinome movie, installed bymachinome[movie]andmachinome movie setup(machinome movie).Expect one rebuild after upgrading. A node is rebuilt only for edits to what it names in its sources, but the first edit after the upgrade is judged by the earlier rule and rebuilds what it would have; the edits after it are spared. Nothing is to be run by hand.
The viewer flag
A still, a development session and an export each use a viewer, chosen by
name: the OpenSCAD viewer or the browser viewer, web.
Write
--viewerwhere you wrote--renderer.machinome snapshot --renderer webis refused, naming the new spelling, andmachinome snapshot --viewer webtakes the same image.machinome developandmachinome exporttake--viewertoo.Name a project’s viewer once. A project whose stills are all taken in the browser declares
viewer = "web"under[tool.machinome]and drops the flag; the flag still wins where it is given. Without either, a still is OpenSCAD’s and serving and embedding are the browser’s, as before.Install the OpenSCAD viewer with your node types.
machinome[openscad]andmachinome[solid2]install it; a project of other parts that takes its stills through OpenSCAD installspip install "machinome[viewer-openscad]". Without it,machinome snapshotnames that extra and--viewer web.Read
machinome viewerfor the installed browser viewer. The entry pointmachinome.vieweris gone: the framework imports the viewer at its address and runs it in its own process. A host that read the entry point readsmachinome viewer’s report, which is unchanged.
The viewer’s command
The browser viewer installs no command of its own: its verbs are
machinome viewer’s.
Write
machinome viewer describe,serveandcapturewhere you wrotemachinome-viewer describe,machinome-viewer serveandmachinome-viewer capture. The options are the same, and so are the report, the served pages and the images. A host that ranmachinome-viewer describerunsmachinome viewer, whose output is the same.Drop
--dev,--frontend-portand--start-frontendfromserve. They did nothing since the development page became a static file, andmachinome viewer serverefuses them as unknown options.Expect the report from
python -m machinome.viewer.webalone. The module form runsmachinome viewer: with no verb it prints the report where it printed its help, and-hprints the help.
Upgrading from Machinome 0.8.0 to 0.8.1
Machinome 0.8.1 corrects 0.8.0 and adds nothing to its vocabulary, but a few corrections refuse what 0.8.0 let pass or rename what it named. A project meets each of them at the line concerned, and none changes a published document.
Address an assembly’s children by their declarations. Inside an assembly’s
render()orsimulate(), a read of an internal node’schildrenbefore the framework has linked them raisesStructureError, naming the assembly, the phase and the attributes to address instead. 0.8.0 answered an empty list, so a loop over it did nothing. Writefor part in (self.near, self.far):over the declared attributes, as the refusal lists them; a read after linking, or outside any phase, answers as before.Expect
kids-0for a one-member binding. A production names the members of a repeated or tuple child binding by index at every count, so the one member of a one-member binding iskids-0, where 0.8.0 named itkids. A drafted manifest or a test that reads the former path reads the new one.Pass the identity to
ClockedSnapshot. A clocked snapshot carries the identity of the machine it was taken from, assim.identitygives it, andClockedSnapshot(model, values, identity)takes it as its third argument.sim.restore()refuses, with aValueErrornaming both identities, a snapshot taken under another identity, which 0.8.0 restored when the class name and the bank’s ids matched. Take snapshots withsim.snapshot()and restore them into the machine they came from.Catch
ValueErrorfor an undeclared source. A subclass ofStlNode,StepNode,JScadNodeorOpenScadNodethat does not declare its source attribute, or declares it empty, is refused when constructed with aValueErrornaming the class, the attribute and the module to set it in.JScadNoderaised a bareExceptionandOpenScadNodeaTypeError. A leaf written outside machinome gets the same refusal frommachinome.node.sources.require_source_file(type(self), attribute, declared).Upgrade the viewer with the framework.
machinome[viewer]andmachinome[web-snapshot]requiremachinome-viewer0.8.1 or newer;pip install --upgrade "machinome[viewer]"moves both.
Changelog lists every correction of 0.8.1.
Upgrading from Machinome 0.7 to 0.8
Machinome 0.8 removes and renames without aliases: a former spelling fails at the line that uses it, naming what to write instead. These are all of its breaking changes, and what to change for each.
Install the extras your parts use. A bare
pip install machinomecarries no CAD kernel, no SolidPython and no manifold3d. Name the extra of each node type and engine your project uses, orall; see Install the extras your parts use and Install.Import every node name from its module. The root of
machinome.nodeexports nothing; each of its twenty-one former names is imported from the module that defines it, and a star import from the root binds nothing. See Import every name from its module.Rename the adapters’ addresses.
machinome.node.adaptersis dissolved:machinome.node.adapters.<x>ismachinome.node.<x>, for examplefrom machinome.node.step import StepAssembly.Rename the engine flags and the test variable.
machinome test --exactand--facetedare--brepand--mesh;SOLID_TEST_KERNELis refused whenever it is set, and the run’s engine isSOLID_TEST_ENGINE,brepormesh. See Use the engines’ names.Import the B-rep operations and the engines’ seams from the engine package.
machinome.exactandmachinome.mesh_engineare removed;intersect_shapes,fuse_shapes,placed_shape,solid_countandsolid_volumearemachinome.engine.brep’s, under the same names and signatures. See Use the engines’ names.Wrap a node’s shape where you use CadQuery’s API on it.
shape()and the B-rep operations return the kernel’s ownTopoDS_Shapeinstead of a CadQueryShape; a project that calls CadQuery’s methods on one wraps it,cadquery.Shape.cast(node.shape()). Passing it to an assertion or an operation needs nothing.Rename the B-rep leaf base and its flag.
ExactLeafNodeatmachinome.node.exact_leafisBrepLeafNodeatmachinome.node.brep_leaf, and a node’sexactflag isbrep.Declare leaf contract 3 in a leaf package. A node type written outside machinome may state the leaf contract it was written against as
leaf_contract = 3in its class body; a class declaring another number is refused naming both. The hooks ofSheetLeafNode(profile_faces,lies_on_xy_plane,extrude,write_dxf(face, path)) and ofFlexibleNode(shape_parameters,shape_spec,snapshot_mesh,snapshot_stl,snapshot_shape) lose their leading underscore, andwrite_dxfwrites to the path it is given.Install the OpenSCAD family’s extras and use its addresses.
Solid2Nodeneedsmachinome[solid2],OpenScadNodeand the OpenSCAD renderer ofmachinome snapshotneedmachinome[openscad]; the SCAD members belong to the family’s leaf base,as_scadispresent, andmachinome.openscadismachinome.node.openscad.binary. See Install the OpenSCAD family’s extras.Read SCAD text where it is written now. A build writes the
.scadof an OpenSCAD-family part only, and removes the others an earlier build left; the SCAD text of any node isscad_code(node)frommachinome.node.openscad.writer.assemble(),present()andartifact_import()return machinome’s presentation description,Rotation.scad()andTranslation.scad()are removed, andBuildertakes noscad_output.Import the symbolic value from the expression graph.
machinome.scad_expressionis removed; its names (get_animation_time,GraphValue, …) are imported frommachinome.expression_graph. A symbolic value is machinome’s own type, not a SolidPython class, and asking it for its truth raisesSymbolicTruthError, anException. Read the animation time asself.timeinsidesimulate(): SolidPython’s own values, such assolid2.get_animation_time(), are expressions only in a process that importedmachinome.node.solid2.scad_expressioninmachinome.core.expressionsisclosed_expression, andOPENSCAD_FOVinmachinome.core.cameraisDEFAULT_FOV.Expect new projects to import per module.
machinome newandmachinome import-stepwritefrom machinome.node.<module> import <name>lines, andmachinome newscaffolds aSolid2Nodewhere SolidPython is installed, aCadQueryNodewhere only CadQuery is, and refuses naming both extras with neither.Expect one recomputation. Nothing is to be run by hand. Every project’s kept verdicts (
_build/.verdicts) recompute once, so the firstmachinome testafter the upgrade costs what a first run costs; the STL of every mesh fusion is written again once, to the same bytes, because its recorded recipe is renamed; and a part whose module was rewritten, or whose class is one of the leaf classes itself, rebuilds once, to the same bytes, because its module is part of its recipe.
No published document changes: exports keep document versions 1 to 13, and a 0.7 viewer reads a 0.8 export.
Install the extras your parts use
Each CAD kernel and node family is an extra named for the last component of
the module that needs it: machinome[cadquery], [build123d],
[step], [molejo], [brep], [mesh], [openscad],
[solid2], [jscad], [stl] and [all]. Without its extra,
importing a module refuses with the line that installs it, for example:
ModuleNotFoundError: machinome.node.cadquery (CadQueryNode) needs
cadquery, which is not installed; install it with
'pip install "machinome[cadquery]"'
The mesh engine, machinome[mesh], is needed by a project that compares a
part without B-rep geometry, runs machinome test --mesh, calls
assertAssemblySupported, fuses meshes, or imports manifold3d or calls
trimesh.boolean itself; each of those refuses naming the extra without
it, and machinome test on the mesh engine refuses at its start. A
project that imports cadquery or build123d in its own modules needs
the extra of that name. machinome import-step needs machinome[step].
Install the OpenSCAD family’s extras
SolidPython is no longer a required dependency: Solid2Node needs
pip install "machinome[solid2]", and OpenScadNode and the OpenSCAD
renderer of machinome snapshot need pip install "machinome[openscad]"
(machinome[solid2] includes it, and machinome[all] installs both).
Without the extra, importing the node type refuses with the line that
installs it, and machinome snapshot with its default renderer exits 1
before loading the model, naming the extra and --renderer web.
OpenScadNode is machinome.node.openscad.OpenScadNode and
Solid2Node machinome.node.solid2.Solid2Node. The OpenSCAD binary
helpers require_openscad, openscad_binary and OpenScadUnavailable
are imported from machinome.node.openscad.binary where they were
machinome.openscad’s, and the SCAD writer is
machinome.node.openscad.writer. A node’s SCAD members (scad_file,
scad_code, generate_scad, fn) belong to the family’s leaf base,
machinome.node.openscad.leaf.ScadLeafNode; a node’s presentation hook is
present. A project leaf that presented its render as SCAD by overriding
as_scad, rather than subclassing Solid2Node, is no longer handed to
OpenSCAD: it is refused for producing no STL, naming it. Subclass
Solid2Node instead.
Use the engines’ names
Machinome 0.8 names the two engines for the representation each consumes: the B-rep engine, over boundary representations, and the mesh engine, over triangle meshes. The words exact and faceted leave every address, flag and value; nothing aliases a former name.
Machinome 0.7 |
Machinome 0.8 |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
a node’s |
|
A former flag is refused as an unrecognised argument. SOLID_TEST_KERNEL
is not read and not ignored: when it is set to anything, machinome test
exits before it builds, naming SOLID_TEST_ENGINE, so rename the line in
every checkout’s .env (the file is not tracked, so a search of the
repository does not find it) and in any CI job that exports it. A
SOLID_TEST_ENGINE set to exact or faceted is refused naming the
two accepted values.
shape() and the operations of machinome.engine.brep return the
kernel’s own TopoDS_Shape. Where a project calls CadQuery’s methods on
one (translate, Solids, Volume, BoundingBox…), wrap it
first, cadquery.Shape.cast(node.shape()); passing it to an assertion or
to an engine operation needs nothing.
Import every name from its module
Machinome 0.8 gives every name of the node package one address, the module
that defines it. The package’s root, machinome.node, exports nothing: a
class, function or declaration is imported from its module, and nothing
aliases a former spelling. Importing one of the names below from the root,
or reading it as an attribute of the root, fails at that line with an
ImportError naming the module and the line to write, for example:
ImportError: module 'machinome.node' has no attribute 'AssemblyNode':
the root of machinome.node exports nothing, and 'AssemblyNode' is
imported from its module, 'machinome.node.assembly'. Write
`from machinome.node.assembly import AssemblyNode`.
Each name and the module to import it from:
Name |
Module |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
An import line naming several of them becomes one line per module. The
package’s submodules are still imported through it (from machinome.node
import supported), and a star import from the root binds nothing. The
files machinome new and machinome import-step write import from the
modules too.
A rewritten import line changes no artifact byte, but a part’s module is part of its recorded source, so each part whose module was rewritten rebuilds once, on its next build, to the same bytes; and, as after any framework upgrade, the project’s kept verdicts recompute once. Nothing is to be run by hand.
Upgrading from solid-node 0.6 to Machinome 0.7
Machinome 0.7 continues solid-node 0.6.0 with the same Git history. The framework and the GitHub organisation were renamed because solid-node could be mistaken for a node in Tim Berners-Lee’s Solid project, and LibreSolid for a libre edition of it. Source code for machines describes this project’s purpose.
Change the names together
There is no solid_node import shim or solid command alias.
Former name |
Machinome 0.7 |
|---|---|
Distribution |
|
Python imports |
|
Command |
|
Manifest |
|
Environment |
|
Repository |
|
Documentation |
|
Viewer |
|
Viewer entry point |
|
Mechanics |
|
Sphinx |
|
Browser |
|
DOM/API |
|
Update requirements, scripts, CI, imports, configuration and embedding
hosts as one migration. Recognised old manifest tables and environment
names fail with migration messages. New documents use
format: "machinome-export"; the matching viewer still reads committed
solid-node-export documents. The rename alone does not change a
document’s schema version. Historical release records retain the old names.
The prefix migration applies to former SOLID_NODE_* settings.
The current implementation still reads SOLID_BUILD_DIR,
SOLID_TEST_VOLUME_EPSILON and SOLID_TEST_PLACEMENT_QUANTUM under
those names; do not mechanically rename them. The run’s engine is
SOLID_TEST_ENGINE since 0.8 (see above). See Command line reference for
the complete environment table.
Update port imports
Ports and time declarations live in machinome.motion.ports, not
machinome.node. Parameter kinds live in machinome.parameters:
from machinome.node.assembly import AssemblyNode
from machinome.node.cadquery import CadQueryNode
from machinome.parameters import Length, Count
from machinome.motion.ports import RotationalPort, TranslationalPort, Time
from machinome.motion.joints import Revolute, Prismatic
from machinome.simulation import Driver, State, Instruction, Sim
Constructor-based nodes and direct rotate() / translate()
motion remain supported. Adopt typed parameters and declared children
incrementally; keep CAD construction in each leaf’s render().
See Values: parameters, constants, ports.
Separate rest from motion
Create children and place them at rest in render(). Put runtime
bindings and transformations in simulate(). A legacy render()
that reads time, drivers or ports remains supported but warns and reruns
per binding. Do not recreate children or accumulate transforms in
simulate().
A class-body joint uses the declaring body’s own frame; a joint declared where a parent places a child uses that parent’s frame. Preview projects using the earlier joint semantics must recheck axes and anchors. See Joints.
Choose the simulation your machine needs
An undeclared timeline remains normalized from 0 to 1.
Time(loop=seconds) gives it a duration; set_keyframe() and
testing decorators then take seconds, while snapshot --time
still takes a timeline fraction.
Time.running() opts into a simulation that integrates movement
and retains coordinate history. Use movement requests, not direct
position assignment, to operate it. Time.elapsed() declares
non-wrapping seconds without selecting running mechanics.
Declaring a State anywhere in the tree selects a clocked machine:
Sim(machine) accepts requests without dt, and committing
relations write memory at events. Add Time.elapsed() when those
events need a clock. A state is not a user input; instructions and
set_state cannot write it. Clocked instructions name exactly one
driver, and their duration controls the viewer’s drawing of the request.
See Three ways a machine runs for the separate execution models
and their limits.
Install a matching viewer
The viewer is installed through the viewer extra, whose pin follows
the framework’s release, so upgrading the framework through the extra
upgrades the pair. It is required by ordinary machinome develop.
--no-web retains the watch-and-build loop. OpenSCAD remains a
modelling backend and snapshot renderer; develop --openscad is no
longer an interactive-viewer option.
The matching viewer is 0.9.0, API 29, reading
document schemas 1 to 13. Check machinome viewer for the
installed package, API and documentVersions. A clocked machine
requires schema 8; newly exported running models require schema 11 and a
viewer supporting source-timed motion (introduced by API 24); one
carrying a Follow relation requires schema 12 (introduced by API 25),
and one whose running Bound uses finite profile contact requires
schema 13 (introduced by API 26). Re-export running models;
endpoint-era snapshots refuse restore into the new semantic identity, so
restart from the initial model state and replay intended commands.
Hosts must update their bundle and the renamed
JavaScript/DOM surface together. See What a build publishes.
The mechanics extra selects the independent
machinome-mechanics 0.1.0 package. Projects using the unreleased
machinome.mechanisms helpers must change those imports to
machinome_mechanics; names, signatures and formulas are preserved.
The framework does not re-export the helpers. The pages on the
mechanics helpers cover installation,
coordinate conventions and every helper.
In 0.8 the studio extra named Machinome Studio, which no index served.
Verify your project
Run machinome models, build every named model, rerun mechanical
and scenario tests, inspect representative poses, and regenerate exports.
A state-only test does not establish geometric fit.
Start with a clean virtual environment so an old solid executable
or old viewer cannot mask a missed rename. For users coming from 0.5,
reinstallation is also required by the OCCT dependency transition
introduced in 0.6; source must then be migrated to the 0.7 names above.