by John Lauer
ZLTECH ZLLG16ASM800 V2.0: 16 inch (398 mm) 48 V direct drive hub servo motor, 17 N m rated, 51 N m peak, 150 rpm, 20 pole pairs, 4096-line encoder with Halls and thermistor. 3D model, dimensions and wiring.
← Commit history
Add README, license and 3D model provenance
6 files changed
+425−2
LICENSEadded+15@@ -0,0 +1,15 @@+MIT License++Copyright (c) 2026 John Lauer++Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.++---++Scope. The MIT license above covers the content written for this page: the README text, the renders in docs/views and docs/showcase.png, the scripts in provenance/tools, the provenance records, and the colouring, naming and pose data added to zllg16asm800.glb.++It does not cover the manufacturer's material, which stays the property of ZLTECH (Shenzhen Zhongling Technology Co., Ltd.) and is included for reference only: vendor/ZLLG16ASM800-V2.0.step, the geometry inside zllg16asm800.glb that is derived from it, and the drawing, photo and test sheet images in docs/figures.
README.md+218−2@@ -1,3 +1,219 @@-# ZLTECH ZLLG16ASM800 V2.0 Hub Servo Motor+# ZLTECH ZLLG16ASM800 V2.0 hub servo motor -ZLTECH ZLLG16ASM800 V2.0: 16 inch (398 mm) 48 V direct drive hub servo motor, 17 N m rated, 51 N m peak, 150 rpm, 20 pole pairs, 4096-line encoder with Halls and thermistor. 3D model, dimensions and wiring.+++The ZLLG16ASM800 V2.0 is a 16 inch (398 mm) wheel with a brushless servo motor built into the hub, made by ZLTECH (Shenzhen Zhongling Technology Co., Ltd.). It is a direct drive wheel: there is no gearbox, the tyre turns with the outer rotor, and the fixed axle on one side carries the mount and both cables. A 4096-line encoder with differential A and B outputs, three Hall sensors and a thermistor come out on one 12-position signal connector. ZLTECH sells it for outdoor mobile robots and pairs it with its ZLAC8030L servo driver, though any 48 V three-phase field-oriented drive that reads Halls and a quadrature encoder can run it.++The interactive 3D model at the top of this page is the vendor's own STEP model, coloured and compressed for the web. Every figure below is taken from ZLTECH's documents; where two sources disagree, both are shown.++## Key specifications++Source: ZLTECH product drawing "ZLLG16ASM800 V2.0 (Single shaft)", version V1.00, dated 2022.09.26, from ZLTECH's own site ([PDF](https://www.zlingkj.com/Data/zlingkj/upload/file/20240102/ZLLG16ASM800%20V2.0%E5%8D%95%E5%87%BA%E8%BD%B4.pdf)).++| Parameter | Value |+|---|---|+| Manufacturer | ZLTECH (Shenzhen Zhongling Technology Co., Ltd.) |+| Part number | ZLLG16ASM800 V2.0, single shaft |+| Type | Brushless hub servo motor, direct drive, outer rotor |+| Nominal size | 16 inch |+| Wheel diameter | 398 ±2 mm |+| Rated voltage | 48 V DC |+| Pole pairs | 20 |+| Rated torque | 17 N m |+| Peak torque | 51 N m |+| Rated current | 7.5 A |+| Peak current | 22 A |+| Rated speed | 150 rpm (3.1 m/s at the tyre) |+| Peak speed | 180 rpm (3.75 m/s at the tyre) |+| Encoder | 4096 lines, differential A and B |+| Commutation sensors | Hall HU, HV, HW |+| Temperature sensor | Thermistor, two wires (type not given on the drawing) |+| Winding resistance | 0.7 Ω ±10% (the drawing's "wire resistance") |+| Winding inductance | 1.885 mH ±10% (the drawing's "wire inductance") |+| Back-EMF constant | 0.262 V/rpm ±10% |+| Maximum load | 200 kg per pair of wheels |+| Tyre | Pneumatic rubber, 65 ±5 Shore A |+| Weight | 10.15 kg ±5% |+| Insulation | 500 V DC, more than 20 MΩ. Dielectric strength 600 V, 50 Hz, 1 minute, 5 mA or less |+| Ambient temperature | -20 to +40 °C |+| Ambient humidity | 20 to 80 % |+| Cable length | 600 ±50 mm |++The tyre speeds in brackets are worked out here from the 398 mm diameter, they are not on the drawing. The drawing does not state a rated power or an ingress protection rating. See [Where the sources disagree](#where-the-sources-disagree) before you rely on load, protection or current figures.++## Views++++++++These are renders of the 3D model on this page. The model has a smooth tyre and no label: the real wheel has a block tread and a ZLTECH label on the outer cover, as in the vendor's photos below. The model's cables stop about 95 mm past the axle end; the real cables are 600 mm long.++++## Mechanical dimensions++++| Dimension | Drawing | Vendor STEP model |+|---|---|---|+| Tyre outer diameter | 398 ±2 mm | 398.0 mm |+| Tyre width | 98 ±1 mm | 97.9 mm |+| Overall width, outer cover face to axle end | 160 ±0.5 mm | 160.0 mm |+| Axle length past the tyre side face | 61.25 ±0.3 mm | 61.3 mm |+| Tyre side face to the washer seat | 1.25 mm | 1.3 mm |+| Axle thread | M24 x 2 | |+| Axle flats, across | 16 mm, +0 / -0.1 | |+| Cable length | 600 ±50 mm | not modelled in full |+| Weight | 10.15 kg ±5% | |++The last column is measured from the vendor's STEP model as a check on the drawing. The meaning of the 1.25 mm dimension is read from the drawing and the model together; the drawing does not label it.++These sizes are not on the drawing. They are measured from the vendor's STEP model, so treat them as reference only:++| Feature | Measured from the STEP model |+|---|---|+| Axle nut | 36 mm across the flats, 17 mm thick |+| Axle washer | 45 mm outside diameter, 3 mm thick |+| Motor cover diameter | 182 mm |+| Rim outside diameter | 221 mm |++### Mounting++The wheel is a single shaft type. It is held by its axle on one side only, and everything else turns.++- The axle is threaded M24 x 2 and has two flats, 16 mm across. The flats are what stop the axle turning in its bracket, so the bracket needs a matching slot or clamp. The nut and washer hold the axle in place.+- 61.25 mm of axle stands out past the tyre side face. That is all the length there is for a bracket, the washer, the nut, and anything else mounted on the axle.+- Both cables leave through the bore at the end of the axle, so the bracket must leave the axle end clear.+- The drawing gives no tightening torque for the nut and no allowed radial or bending load on the axle beyond the 200 kg per pair rating.++## Wiring++++Two cables leave the axle. The drawing titles this table "8030L Wiring Sequence", meaning it matches ZLTECH's ZLAC8030L driver.++### Power cable (three motor phases)++| Wire colour | Signal |+|---|---|+| Yellow | U |+| Green | V |+| Blue | W |++### Signal cable connector (12 positions)++| Pin | Wire colour | Signal |+|---|---|---|+| 1 | Brown | Encoder A+ |+| 2 | Brown and black | Encoder A- |+| 3 | Grey | Encoder B+ |+| 4 | Grey and black | Encoder B- |+| 5 | White | Thermistor |+| 6 | White and black | Thermistor |+| 7 | Green | Hall HV |+| 8 | Blue | Hall HW |+| 9 | Yellow | Hall HU |+| 10 | (none) | Not connected |+| 11 | Red | +5 V |+| 12 | Black | GND |++++The connector has two rows of six. One row is the odd pins 1 to 11 from left to right, the other row is the even pins 2 to 12 from left to right, as the drawing shows.++What the drawing does not say, so check on the part before you design to it:++- The make and part number of the signal connector and of its mate.+- The thermistor type and resistance. The two thermistor wires are not marked with a polarity.+- Whether the Hall outputs are open collector and need pull-up resistors.+- Whether the encoder has an index channel. Only A and B are listed.+- The wire gauges of either cable.++Note that the green and blue wires in the signal cable (Halls) are not the green and blue wires in the power cable (phases V and W).++## Load test at 48 V++++ZLTECH's dynamometer sheet for the ZLLG16ASM800 (motor load characteristics curve, sheet number FA2101050006, test date 2021/01/05) was supplied with the motors. It names the motor ZLLG16ASM800 without the V2.0 suffix and is older than the V2.0 drawing, so read it as typical behaviour, not as a guarantee for a V2.0 wheel. The current column is the supply current at the 48 V input (the input power column is that voltage times that current), not the motor phase current.++| Point | Torque | Speed | Output power | Supply current | Input power | Efficiency |+|---|---|---|---|---|---|---|+| No load | 0.41 N m | 227.0 rpm | 9.8 W | 1.06 A | 41.6 W | 23.5 % |+| Best efficiency | 11.22 N m | 195.4 rpm | 229.6 W | 6.33 A | 303.1 W | 75.7 % |+| Nearest row to rated torque | 17.77 N m | 179.0 rpm | 333.1 W | 9.56 A | 459.6 W | 72.5 % |+| Most output power | 40.15 N m | 126.6 rpm | 532.3 W | 20.99 A | 1005.5 W | 52.9 % |+| Most torque tested | 48.72 N m | 78.9 rpm | 402.5 W | 23.00 A | 1084.3 W | 37.1 % |++The sheet's header lists the test bench settings as 48.0 V, 20.0 A and 800.0 W. Those are not the motor's rated current and power: the drawing gives 7.5 A rated, and the largest output power in the test is 532 W.++## Where the sources disagree++Three sources describe this motor and they do not agree. This page uses the first column.++| Figure | ZLTECH drawing, 2022.09.26 (on ZLTECH's site) | ZLTECH drawing, 2022.02.18 (supplied with the motors) | Reseller listing (AIFITLAB) |+|---|---|---|---|+| Rated torque | 17 N m | 17 N m | 15 N m |+| Peak torque | 51 N m | 51 N m | 45 N m |+| Rated current | 7.5 A | 7.5 A | 10 A ("rated phase current") |+| Peak current | 22 A | 22 A | 30 A |+| Rated speed | 150 rpm | 150 rpm | 200 rpm |+| Maximum speed | 180 rpm | 180 rpm | 300 rpm |+| Maximum load per pair | 200 kg | 300 kg | 200 kg |+| Protection level | not stated | IP65 | IP54 |+| Rated power | not stated | not stated | 800 W |+| Tyre | pneumatic rubber | rubber | rubber pneumatic tyre |++The two ZLTECH drawings carry the same version number, V1.00, and differ only in the date, the load figure, the tyre wording and the protection level row, which the later drawing leaves out. Until ZLTECH confirms otherwise, the careful reading is 200 kg per pair, and IP65 should not be assumed. The reseller's speeds and currents do not match either drawing or the load test, where the no-load speed at 48 V is 227 rpm.++## 3D model and its provenance++| File | What it is |+|---|---|+| [zllg16asm800.glb](zllg16asm800.glb) | The model shown on this page. 263 KB, 18 parts, about 98,700 triangles, Draco compressed. |+| [vendor/ZLLG16ASM800-V2.0.step](vendor/ZLLG16ASM800-V2.0.step) | ZLTECH's STEP model, unchanged. 2.4 MB, 18 solids, written by SolidWorks 2020 on 2023-12-14. SHA-256 `90799f3d77f5ed5d0653941bfa2a352e87d84e68a04986555ade4eb68f5349cc` |+| [provenance/3d-model.json](provenance/3d-model.json) | Every step from the STEP to the GLB, with hashes |+| [provenance/tools/](provenance/tools/) | The scripts that did it |++How the GLB was made:++1. The vendor STEP was converted by the Adom step2glb service (OCCT), which keeps the solids as separate named parts.+2. **The vendor STEP has no colour data at all, so the colours are ours.** A black tyre, a dark rim, grey metal covers, a steel axle, a zinc nut and washer, a brass valve, black cables and a white connector were assigned per solid. In the vendor's photos the rim and the motor covers are black; they are drawn lighter here so that the parts can be told apart. Do not read a finish or a material from the model.+3. The part names (tyre, rim, motor cover, bearing and so on) are also ours, given from each solid's shape and position. The STEP names its solids only PRT0001 to PRT0012 and similar.+4. The geometry is the vendor's. Nothing was added, removed, scaled or reshaped. The faces of each solid were joined into one mesh and compressed.+5. Pose: Z is up and the axle lies along Y, with the cables leaving at +Y, as the wheel stands on a robot. The vendor's axes already had that orientation, so there is no rotation, only a shift that puts the middle of the tyre at y = 0 and the bottom of the tyre on z = 0. The STEP file keeps the vendor's own origin, which is on the axle axis, 34.25 mm from the middle of the tyre.++The model was checked against the drawing (the table under Mechanical dimensions) and looked at in the Adom 3D viewer from the axle side, the outer side, the side and the front. The views on this page are those renders.++Not in the model: the tread pattern, the label on the outer cover, the full length of the cables, and anything inside the motor beyond the vendor's simplified solids.++## Manufacturer documents++| Document | Where |+|---|---|+| Product page | [ZLLG16ASM800 V2.0 on zlingkj.com](https://www.zlingkj.com/en/robot-hub-servo-motor-series/923257) |+| Product drawing with motor parameters and wiring (V1.00, 2022.09.26) | [PDF on zlingkj.com](https://www.zlingkj.com/Data/zlingkj/upload/file/20240102/ZLLG16ASM800%20V2.0%E5%8D%95%E5%87%BA%E8%BD%B4.pdf) |+| All ZLTECH product drawings | [zlingkj.com downloads](https://www.zlingkj.com/en/download/product-drawings) |+| Reseller listing with a dimension drawing | [AIFITLAB](https://aifitlab.com/products/zhongling-zllg16-asm800-v2-0-motor) |+| Load test sheet FA2101050006 | Supplied with the motors. No public link was found, so it is shown above as an image. |++The full motor parameter table from the drawing, as ZLTECH prints it:++++The PDFs are not copied onto this page. They are ZLTECH's documents; follow the links for the originals.++## Sourcing++Mouser, DigiKey and JLCPCB/LCSC do not list this motor (searched 2026-11-21). It is sold by ZLTECH directly and through robotics resellers such as AIFITLAB.++## Used in++- [Hub Motor Robot](https://wiki.adom.inc/john/hub-motor-robot): an outdoor robot that drives on two of these wheels, one motor driver board per wheel.++## License++The text, renders, scripts and the colouring and naming of the GLB on this page are released under the MIT license, see [LICENSE](LICENSE). The STEP model, the drawings, the photos and the load test sheet are ZLTECH's and stay ZLTECH's; they are shown here for reference and are not relicensed. ZLTECH is a trademark of its owner. This page is not written or endorsed by ZLTECH.
provenance/3d-model.jsonadded+57@@ -0,0 +1,57 @@+{+ "schema": "adom/3d-model-provenance@1",+ "mpn": "ZLLG16ASM800 V2.0",+ "manufacturer": "ZLTECH (Shenzhen Zhongling Technology Co., Ltd.)",+ "source": {+ "file": "vendor/ZLLG16ASM800-V2.0.step",+ "sha256": "90799f3d77f5ed5d0653941bfa2a352e87d84e68a04986555ade4eb68f5349cc",+ "bytes": 2441616,+ "author": "ZLTECH",+ "written_by": "SolidWorks 2020 (SwSTEP 2.0), STEP AP203, 2023-12-14",+ "units": "mm",+ "solids": 18,+ "colours_in_source": false,+ "up_axis": "Z, with the axle along Y: the wheel already stands upright",+ "origin": "on the axle axis, 34.25 mm from the tyre mid-plane toward the outer side"+ },+ "derived": {+ "file": "zllg16asm800.glb",+ "sha256": "cef5d31ff97cda173b191f1a7a520aa49c3c5f5b48d0e4ceb94620186933a3a4",+ "frame": "metres, Z up, axle along Y with the cables leaving at +Y, tyre mid-plane at y = 0, tyre bottom at z = 0",+ "source_to_display": { "rotation": "none", "translation_m": [0.0, -0.03425, 0.199], "scale": "mm to m only" },+ "parts": 18,+ "triangles": 98703,+ "compression": "KHR_draco_mesh_compression, KHR_mesh_quantization",+ "gpu_instancing": false+ },+ "steps": [+ { "tool": "step2glb convert (Adom step2glb service 1.9.8, OCCT XCAF)", "what": "STEP to GLB, one mesh per solid, no materials because the STEP has no colours" },+ { "tool": "provenance/tools/build_glb.py", "what": "materials per solid, readable part names, hover tooltips, the root translation. Only the glTF JSON is changed; the geometry bytes are untouched" },+ { "tool": "gltf-transform 3.10.1 join --keepNamed, weld, draco", "what": "one primitive per part instead of one per CAD face, shared vertices welded, Draco compression" }+ ],+ "colours": {+ "origin": "added by Adom, chosen by hand, not measured and not from the manufacturer",+ "note": "In the manufacturer's product photos the rim and the motor covers are black. They are drawn lighter so the parts can be told apart.",+ "materials": {+ "tyre": "#2b2c2f", "rim": "#4b5058", "motor covers and centre cap": "#7b828c", "motor shell": "#3a3d43",+ "axle": "#a9afb7", "nut and washer": "#cfd3d8", "bearings": "#8d939b", "tyre valve": "#b9923a",+ "cables": "#18191b", "signal connector": "#e9e7df", "cover plate": "#2a2d32"+ }+ },+ "part_names": "given by Adom from each solid's shape and position; the STEP names the solids PRT0001 to PRT0012 and similar",+ "checks": [+ { "what": "tyre outer diameter", "drawing_mm": "398 +/-2", "model_mm": 398.0 },+ { "what": "tyre width", "drawing_mm": "98 +/-1", "model_mm": 97.9 },+ { "what": "overall width, outer cover face to axle end", "drawing_mm": "160 +/-0.5", "model_mm": 160.0 },+ { "what": "axle length past the tyre side face", "drawing_mm": "61.25 +/-0.3", "model_mm": 61.3 },+ { "what": "tyre side face to washer seat", "drawing_mm": "1.25", "model_mm": 1.3 },+ { "what": "looked at in the Adom 3D viewer (axle side, outer side, side, front)", "result": "upright, parts coloured as listed, no missing solids" }+ ],+ "not_in_model": ["tread pattern", "label on the outer cover", "full 600 mm cable length (the model's cables stop about 95 mm past the axle end)"],+ "drawing": {+ "title": "ZLLG16ASM800 V2.0 (Single shaft), version V1.00, dated 2022.09.26",+ "url": "https://www.zlingkj.com/Data/zlingkj/upload/file/20240102/ZLLG16ASM800%20V2.0%E5%8D%95%E5%87%BA%E8%BD%B4.pdf",+ "sha256": "fb77e1b50cfd34c0571d69b197218ddb5a916281a234c36ebe6f682492633fb6",+ "fetched": "2026-11-21"+ }+}
provenance/tools/build.shadded+11@@ -0,0 +1,11 @@+#!/bin/bash+# vendor STEP -> coloured, posed, optimised GLB. usage: build.sh vendor.step out.glb+set -e+HERE=$(cd "$(dirname "$0")" && pwd); T=$(mktemp -d)+step2glb convert "$1" -o $T/raw.glb # shared step2glb service (OCCT XCAF), quantized+python3 $HERE/build_glb.py $T/raw.glb $T/c.glb # materials, names, tooltips, pose+G="npx --yes @gltf-transform/[email protected]"+$G join $T/c.glb $T/j.glb --keepNamed true # one primitive per part (the STEP gives one per face)+$G weld $T/j.glb $T/w.glb+$G draco $T/w.glb "$2"+rm -rf $T; ls -la "$2"
provenance/tools/build_glb.pyadded+72@@ -0,0 +1,72 @@+#!/usr/bin/env python3+"""Colour and pose the step2glb output of the vendor STEP (which carries no colours).+usage: build_glb.py raw.glb out.glb+Only the glTF JSON is changed: materials, node names, tooltips, one root translation. Geometry bytes are untouched."""+import sys,os+sys.path.insert(0,os.path.dirname(os.path.abspath(__file__)))+import glbio+src,dst=sys.argv[1:3]+js,bn=glbio.load(src)+def lin(c): return ((c+0.055)/1.055)**2.4 if c>0.04045 else c/12.92+def mat(name,hexc,metal,rough):+ r,g,b=[lin(int(hexc[i:i+2],16)/255) for i in (1,3,5)]+ return {"name":name,"pbrMetallicRoughness":{"baseColorFactor":[r,g,b,1],"metallicFactor":metal,"roughnessFactor":rough}}+MATS={+ "rubber": mat("Tyre rubber (black)","#2b2c2f",0.0,0.82),+ "rim": mat("Rim (dark painted steel)","#4b5058",0.45,0.42),+ "cover": mat("Motor cover (metal)","#7b828c",0.55,0.38),+ "shell": mat("Motor shell (dark metal)","#3a3d43",0.5,0.5),+ "steel": mat("Steel (axle)","#a9afb7",0.7,0.3),+ "zinc": mat("Zinc plated steel (nut, washer)","#cfd3d8",0.7,0.27),+ "bearing": mat("Bearing steel","#8d939b",0.7,0.33),+ "brass": mat("Brass (valve)","#b9923a",0.7,0.35),+ "cable": mat("Cable jacket (black)","#18191b",0.0,0.65),+ "connector": mat("Connector housing (white nylon)","#e9e7df",0.0,0.6),+ "cap": mat("Centre cap (dark)","#2a2d32",0.3,0.5),+}+# vendor solid (node name out of step2glb) -> (new node name, material, tooltip)+PARTS={+ "NAUO23":("tyre","rubber","Tyre\nrubber, 65 +/-5 Shore A, 398 mm diameter, 98 mm wide"),+ "NAUO21":("rim","rim","Wheel rim"),+ "NAUO22":("tyre_valve","brass","Tyre valve"),+ "NAUO12":("motor_shell","shell","Motor shell (outer rotor)"),+ "NAUO19":("motor_cover_axle_side","cover","Motor cover, axle side"),+ "NAUO20":("motor_cover_outer_side","cover","Motor cover, outer side"),+ "NAUO17":("centre_cap","cover","Centre cap"),+ "NAUO15":("cover_plate","cap","Cover plate"),+ "NAUO13":("bearing_outer_side","bearing","Bearing, outer side"),+ "NAUO14":("bearing_axle_side","bearing","Bearing, axle side"),+ "NAUO18":("bearing_retainer","bearing","Bearing retainer"),+ "NAUO16":("axle","steel","Axle\nM24 x 2 thread, 16 mm across the flats, cables exit through the bore"),+ "NAUO6": ("axle_nut_m24x2","zinc","Axle nut, M24 x 2"),+ "NAUO7": ("axle_washer","zinc","Axle washer"),+ "NAUO8": ("cable_sheath","cable","Cable sheath\n600 +/-50 mm long on the real motor; the model stops short"),+ "NAUO9": ("signal_cable","cable","Signal cable (Halls, encoder, thermistor)"),+ "NAUO10":("power_cable","cable","Power cable (U yellow, V green, W blue)"),+ "NAUO11":("signal_connector","connector","Signal cable connector, 12 positions"),+}+names=list(MATS); js["materials"]=[MATS[k] for k in names]+seen=set()+for n in js["nodes"]:+ nm=n.get("name")+ if nm in PARTS and "mesh" in n:+ new,mk,tip=PARTS[nm]; seen.add(nm)+ n["name"]=new; n.setdefault("extras",{})["tooltip"]=tip; n["extras"]["vendorSolid"]=nm+ m=js["meshes"][n["mesh"]]; m["name"]=new+ for p in m["primitives"]: p["material"]=names.index(mk)+assert seen==set(PARTS), set(PARTS)-seen+gen={"NAUO1":"wheel_assembly","NAUO2":"wheel","NAUO3":"cable_assembly","NAUO4":"power_cable_group","NAUO5":"signal_cable_group"}+for n in js["nodes"]:+ if n.get("name") in gen: n["name"]=gen[n["name"]]+# pose: vendor frame already has the axle along Y and the wheel in the XZ plane (Z up = standing).+# Move the tyre mid-plane to y = 0 and the tyre bottom to z = 0. Metres.+T=[0.0,-0.03425,0.199]+root=js["nodes"][js["scenes"][0]["nodes"][0]]+root["name"]="ZLLG16ASM800_V2.0"; root["translation"]=T+js["asset"]["extras"]={"adomModel":{"mpn":"ZLLG16ASM800 V2.0","manufacturer":"ZLTECH (Shenzhen Zhongling Technology Co., Ltd.)",+ "source":"vendor STEP ZLLG16ASM800-V2.0.step, sha256 90799f3d77f5ed5d0653941bfa2a352e87d84e68a04986555ade4eb68f5349cc",+ "frame":"Z up, axle along Y (cable exit at +Y), tyre mid-plane at y = 0, tyre bottom at z = 0, metres",+ "sourceToDisplay":{"rotation":"none","translation_m":T},+ "colours":"added by Adom: the vendor STEP has no colour data. Black tyre, metal hub: chosen by hand, not measured. In the vendor's product photos the rim and motor covers are black; they are shown lighter here so the parts can be told apart.",+ "notInModel":"tread pattern, hub label, full 600 mm cable"}}+glbio.save(dst,js,bn); print("wrote",dst,len(js["materials"]),"materials")
provenance/tools/glbio.pyadded+52@@ -0,0 +1,52 @@+import json,struct+def load(p):+ b=open(p,'rb').read()+ assert b[:4]==b'glTF'+ off=12; js=None; bn=b''+ while off<len(b):+ ln,ty=struct.unpack_from('<II',b,off); data=b[off+8:off+8+ln]; off+=8+ln+ if ty==0x4E4F534A: js=json.loads(data)+ elif ty==0x004E4942: bn=data+ return js,bn+def save(p,js,bn):+ j=json.dumps(js,separators=(',',':'),ensure_ascii=False).encode('utf-8')+ j+=b' '*((4-len(j)%4)%4); bn=bn+b'\0'*((4-len(bn)%4)%4)+ out=struct.pack('<4sII',b'glTF',2,12+8+len(j)+8+len(bn))+struct.pack('<II',len(j),0x4E4F534A)+j+struct.pack('<II',len(bn),0x004E4942)+bn+ open(p,'wb').write(out)++import numpy as np+CT={5120:('i1',127.0),5121:('u1',255.0),5122:('<i2',32767.0),5123:('<u2',65535.0),5125:('<u4',None),5126:('<f4',None)}+NC={'SCALAR':1,'VEC2':2,'VEC3':3,'VEC4':4,'MAT4':16}+def acc(js,bn,i):+ a=js['accessors'][i]; bv=js['bufferViews'][a['bufferView']]+ dt,norm=CT[a['componentType']]; n=NC[a['type']]+ off=bv.get('byteOffset',0)+a.get('byteOffset',0); stride=bv.get('byteStride')+ isz=np.dtype(dt).itemsize*n+ if stride and stride!=isz:+ raw=np.frombuffer(bn,dtype=np.uint8,count=stride*(a['count']-1)+isz,offset=off)+ idx=(np.arange(a['count'])[:,None]*stride+np.arange(isz)[None,:])+ arr=np.frombuffer(raw[idx].tobytes(),dtype=dt).reshape(a['count'],n)+ else:+ arr=np.frombuffer(bn,dtype=dt,count=a['count']*n,offset=off).reshape(a['count'],n)+ arr=arr.astype(np.float64)+ if a.get('normalized'): arr=np.maximum(arr/norm,-1.0) if dt[-2]=='i' else arr/norm+ return arr+def local(n):+ if 'matrix' in n: return np.array(n['matrix'],float).reshape(4,4).T+ t=n.get('translation',[0,0,0]); r=n.get('rotation',[0,0,0,1]); s=n.get('scale',[1,1,1])+ x,y,z,w=r+ R=np.array([[1-2*(y*y+z*z),2*(x*y-z*w),2*(x*z+y*w)],[2*(x*y+z*w),1-2*(x*x+z*z),2*(y*z-x*w)],[2*(x*z-y*w),2*(y*z+x*w),1-2*(x*x+y*y)]])+ M=np.eye(4); M[:3,:3][email protected](s); M[:3,3]=t; return M+def world(js):+ W={}+ def rec(i,P):+ M=P@local(js['nodes'][i]); W[i]=M+ for c in js['nodes'][i].get('children',[]): rec(c,M)+ for r in js['scenes'][js.get('scene',0)]['nodes']: rec(r,np.eye(4))+ return W+def mesh_points(js,bn,ni,W):+ out=[]+ for p in js['meshes'][js['nodes'][ni]['mesh']]['primitives']:+ v=acc(js,bn,p['attributes']['POSITION'])+ out.append((W[ni]@np.c_[v,np.ones(len(v))].T).T[:,:3])+ return out