<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ops-sd</title>
    <description>The latest articles on DEV Community by ops-sd (@opssd).</description>
    <link>https://dev.to/opssd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4265904%2Fa82483d5-636b-4b03-991a-550d6af2527c.png</url>
      <title>DEV Community: ops-sd</title>
      <link>https://dev.to/opssd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/opssd"/>
    <language>en</language>
    <item>
      <title>Building a 100% Browser-Local OSHA 1910.147 LOTO Placard Generator with Vector PDF Export</title>
      <dc:creator>ops-sd</dc:creator>
      <pubDate>Thu, 26 Nov 2026 04:31:04 +0000</pubDate>
      <link>https://dev.to/opssd/building-a-100-browser-local-osha-1910147-loto-placard-generator-with-vector-pdf-export-2gcd</link>
      <guid>https://dev.to/opssd/building-a-100-browser-local-osha-1910147-loto-placard-generator-with-vector-pdf-export-2gcd</guid>
      <description>&lt;p&gt;Industrial maintenance teams still build machine-specific Lockout/Tagout (LOTO) placards in Word or PowerPoint, manually dragging red arrows onto shop-floor photos and hoping nothing shifts when printed at 11×17.&lt;/p&gt;

&lt;p&gt;When we built &lt;a href="https://lotocards.com/" rel="noopener noreferrer"&gt;LotoCard&lt;/a&gt; and the free &lt;a href="https://lotocards.com/loto-viewer" rel="noopener noreferrer"&gt;&lt;code&gt;.lotocard.json&lt;/code&gt; Field-Presence Viewer&lt;/a&gt;, our core engineering constraint was strict &lt;strong&gt;browser-local privacy&lt;/strong&gt;: plant floor photos often contain proprietary tooling and layouts that EHS managers cannot upload to third-party cloud storage.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Keeping Photos 100% Client-Side
&lt;/h2&gt;

&lt;p&gt;All machine photos, numbered energy-isolation callout pins (&lt;code&gt;E-1&lt;/code&gt;, &lt;code&gt;P-1&lt;/code&gt;, &lt;code&gt;H-1&lt;/code&gt;), and revision metadata live in browser memory and serialize to a portable &lt;code&gt;.lotocard.json&lt;/code&gt; document:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Photos are read via &lt;code&gt;FileReader&lt;/code&gt; / &lt;code&gt;ObjectURL&lt;/code&gt;, downscaled locally if needed, and never leave the browser tab.&lt;/li&gt;
&lt;li&gt;Callout coordinates are stored as normalized &lt;code&gt;[0..1]&lt;/code&gt; percentages relative to the image bounds so pins never drift between screen preview, 8.5×11 Letter, and 11×17 Tabloid PDFs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Deterministic 29 CFR 1910.147(c)(4)(ii) Field-Presence Checks
&lt;/h2&gt;

&lt;p&gt;OSHA &lt;code&gt;29 CFR 1910.147(c)(4)(ii)&lt;/code&gt; outlines specific procedural elements a machine-specific energy control procedure must document: intended use, shutdown steps, isolation devices, lockout/tagout application, stored energy dissipation, and verification of isolation.&lt;/p&gt;

&lt;p&gt;Rather than claiming legal compliance certification, we modeled these as a deterministic &lt;strong&gt;field-presence completeness schema&lt;/strong&gt;—highlighting missing verification steps or unpinned energy sources before a placard is printed and laminated.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Clean Vector PDF Output Without a Headless Browser
&lt;/h2&gt;

&lt;p&gt;Generating print-ready 8.5×11 and 11×17 placards directly in the browser with crisp vector callouts, OSHA-style hazard headers, and embedded QR revision codes avoids server-side Puppeteer cold starts and guarantees zero image upload.&lt;/p&gt;

&lt;p&gt;If you want to inspect &lt;code&gt;.lotocard.json&lt;/code&gt; files or test field-presence checks on 16 industrial machine presets (CNC mills, hydraulic presses, air compressors), try the free viewer at &lt;a href="https://lotocards.com/loto-viewer" rel="noopener noreferrer"&gt;lotocards.com/loto-viewer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>pdf</category>
      <category>privacy</category>
    </item>
    <item>
      <title>Deterministic 3D Bin-Packing for USPS Commercial Cubic and DIM-139 Shipping Audits</title>
      <dc:creator>ops-sd</dc:creator>
      <pubDate>Thu, 26 Nov 2026 04:25:27 +0000</pubDate>
      <link>https://dev.to/opssd/deterministic-3d-bin-packing-for-usps-commercial-cubic-and-dim-139-shipping-audits-1ba3</link>
      <guid>https://dev.to/opssd/deterministic-3d-bin-packing-for-usps-commercial-cubic-and-dim-139-shipping-audits-1ba3</guid>
      <description>&lt;p&gt;Most small e-commerce brands ship 80% of their orders in 3 to 5 corrugated box sizes chosen by gut feel. When carrier rates shift—especially &lt;strong&gt;USPS Commercial Cubic tiers&lt;/strong&gt; and &lt;strong&gt;UPS/FedEx DIM-139 dimensional weight&lt;/strong&gt;—even a 1-inch oversized carton can silently bump hundreds of orders into a more expensive pricing tier.&lt;/p&gt;

&lt;p&gt;While building &lt;a href="https://getboxaudit.com/" rel="noopener noreferrer"&gt;BoxAudit&lt;/a&gt; and our free &lt;a href="https://getboxaudit.com/calculators/usps-cubic" rel="noopener noreferrer"&gt;USPS Ground Advantage Cubic Calculator&lt;/a&gt;, we designed a deterministic 3D cartonization pipeline that audits 90 days of historical Shopify, Etsy, ShipStation, or Pirate Ship orders directly against carrier rate tables.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Why USPS Cubic Math Breaks Intuition
&lt;/h2&gt;

&lt;p&gt;USPS Commercial Cubic prices parcels by &lt;strong&gt;cubic feet&lt;/strong&gt; (&lt;code&gt;(L × W × H) / 1728&lt;/code&gt;, rounded down to the nearest 0.25 inch per dimension before multiplying) across 5 tiers (&lt;code&gt;0.1&lt;/code&gt;, &lt;code&gt;0.2&lt;/code&gt;, &lt;code&gt;0.3&lt;/code&gt;, &lt;code&gt;0.4&lt;/code&gt;, &lt;code&gt;0.5&lt;/code&gt; cu ft), as long as the longest side is &lt;code&gt;&amp;lt;= 18"&lt;/code&gt; and actual weight is &lt;code&gt;&amp;lt;= 20 lb&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A box measuring &lt;code&gt;10 × 7 × 5 in&lt;/code&gt; is &lt;code&gt;0.2025 cu ft&lt;/code&gt;, which crosses the &lt;code&gt;0.20&lt;/code&gt; cliff and bills at the &lt;code&gt;0.30&lt;/code&gt; tier. Trimming just half an inch off one side drops it under &lt;code&gt;0.20 cu ft&lt;/code&gt; and saves money on every single shipment—often &lt;code&gt;$1–$3&lt;/code&gt; per order.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Deterministic 3D Orthogonal Bin-Packing vs Heuristics
&lt;/h2&gt;

&lt;p&gt;For multi-SKU orders, naïve volume summation (&lt;code&gt;sum(L*W*H)&lt;/code&gt;) fails because rigid items cannot be melted to fill corners. Instead, we run an exact/deterministic 3D orthogonal packing pass:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;6-orientation rotation search&lt;/strong&gt; per SKU with deterministic tie-breaking so repeated runs always produce identical box assignments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extreme-point candidate placement&lt;/strong&gt; with axis-aligned bounding-box (AABB) overlap rejection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dual-rate comparison&lt;/strong&gt; per candidate box: compute both actual weight vs &lt;code&gt;DIM-139&lt;/code&gt; (&lt;code&gt;ceil(L*W*H / 139)&lt;/code&gt;) and USPS Commercial Cubic tier, then pick the minimum total cost across the entire 90-day order set.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Stripping Buyer PII Locally Before Upload
&lt;/h2&gt;

&lt;p&gt;Order exports from Shopify and ShipStation contain customer names, street addresses, and emails. An audit only needs SKU quantities, dimensions, destination ZIP/zone, and historical postage—never buyer identity. Stripping PII client-side in the browser before running the solver keeps merchant data clean by construction.&lt;/p&gt;

&lt;p&gt;You can test single-box cubic tier cliffs with our free &lt;a href="https://getboxaudit.com/calculators/usps-cubic" rel="noopener noreferrer"&gt;USPS Cubic Calculator&lt;/a&gt; or &lt;a href="https://getboxaudit.com/calculators/dim-weight" rel="noopener noreferrer"&gt;DIM-139 Calculator&lt;/a&gt;, or inspect the full 90-day order audit at &lt;a href="https://getboxaudit.com/" rel="noopener noreferrer"&gt;getboxaudit.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>ecommerce</category>
      <category>webdev</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Parsing Brother #PES0001 and Tajima .DST Binary Stitch Files in Rust and Browser Canvas</title>
      <dc:creator>ops-sd</dc:creator>
      <pubDate>Thu, 26 Nov 2026 04:25:20 +0000</pubDate>
      <link>https://dev.to/opssd/parsing-brother-pes0001-and-tajima-dst-binary-stitch-files-in-rust-and-browser-canvas-213a</link>
      <guid>https://dev.to/opssd/parsing-brother-pes0001-and-tajima-dst-binary-stitch-files-in-rust-and-browser-canvas-213a</guid>
      <description>&lt;p&gt;Embroidery machines still rely on compact binary stitch formats designed decades ago. Two of the most common formats in home and commercial shops are &lt;strong&gt;Brother &lt;code&gt;.PES&lt;/code&gt; (&lt;code&gt;#PES0001&lt;/code&gt;)&lt;/strong&gt; and &lt;strong&gt;Tajima &lt;code&gt;.DST&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When we built the &lt;a href="https://imagetopes.com/pes-file-viewer" rel="noopener noreferrer"&gt;ImageToPES Free .PES &amp;amp; .DST Stitch Viewer&lt;/a&gt; and Rust digitization core at &lt;a href="https://imagetopes.com/" rel="noopener noreferrer"&gt;ImageToPES&lt;/a&gt;, we ran into several subtle binary parsing edge cases worth documenting for anyone working with stitch files.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Brother &lt;code&gt;#PES0001&lt;/code&gt; Header vs Embedded PEC Block
&lt;/h2&gt;

&lt;p&gt;A &lt;code&gt;.PES&lt;/code&gt; file starts with an 8-byte ASCII magic signature (&lt;code&gt;#PES0001&lt;/code&gt; through &lt;code&gt;#PES0060&lt;/code&gt;) followed by a 32-bit little-endian offset pointing directly to the embedded &lt;strong&gt;PEC&lt;/strong&gt; section. Most Brother machines actually read the PEC stitch block rather than the higher-level PES object tree:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Normal stitches&lt;/strong&gt; fit in 1 byte per axis (&lt;code&gt;-63&lt;/code&gt; to &lt;code&gt;+63&lt;/code&gt; in 0.1 mm units).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jump and trim stitches&lt;/strong&gt; use a 12-bit signed displacement packed across 2 bytes when the high bit (&lt;code&gt;0x80&lt;/code&gt;) is set.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Color changes&lt;/strong&gt; are signaled by the two-byte sequence &lt;code&gt;0xFE 0xB0&lt;/code&gt; followed by a control byte.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Validating that the PEC offset stays within file bounds and that stitch coordinates remain inside the target hoop prevents corrupted files from stalling a machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Tajima &lt;code&gt;.DST&lt;/code&gt; Balanced-Ternary Displacement Encoding
&lt;/h2&gt;

&lt;p&gt;Unlike &lt;code&gt;.PES&lt;/code&gt;, a &lt;code&gt;.DST&lt;/code&gt; file begins with a fixed &lt;strong&gt;512-byte ASCII header&lt;/strong&gt; containing metadata tags (&lt;code&gt;LA:&lt;/code&gt;, &lt;code&gt;ST:&lt;/code&gt;, &lt;code&gt;CO:&lt;/code&gt;, &lt;code&gt;+X:&lt;/code&gt;, &lt;code&gt;-X:&lt;/code&gt;, &lt;code&gt;+Y:&lt;/code&gt;, &lt;code&gt;-Y:&lt;/code&gt;), followed by 3-byte stitch records. Each 3-byte triplet encodes &lt;code&gt;dx&lt;/code&gt; and &lt;code&gt;dy&lt;/code&gt; using &lt;strong&gt;balanced ternary&lt;/strong&gt; (&lt;code&gt;±1&lt;/code&gt;, &lt;code&gt;±3&lt;/code&gt;, &lt;code&gt;±9&lt;/code&gt;, &lt;code&gt;±27&lt;/code&gt;, &lt;code&gt;±81&lt;/code&gt; in 0.1 mm increments) distributed across specific bits of all three bytes, with flag bits indicating normal stitch, jump, color stop, or end-of-file (&lt;code&gt;0x00 0x00 0xF3&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Because &lt;code&gt;.DST&lt;/code&gt; stores no RGB thread palette—only color-stop indices—a browser previewer needs either a deterministic fallback palette or user-editable thread colors.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Rendering Real-Time 3D Thread Previews in HTML5 Canvas
&lt;/h2&gt;

&lt;p&gt;Once decoded into &lt;code&gt;(x, y, op, colorIndex)&lt;/code&gt; trajectories in Rust/WASM, rendering realistic stitch previews on an HTML5 Canvas comes down to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Computing hoop bounding boxes and stitch density heatmaps to catch overly dense clusters before stitching.&lt;/li&gt;
&lt;li&gt;Drawing directional highlight/shadow passes per stitch segment so satin fills and running stitches look like physical thread rather than flat 1px lines.&lt;/li&gt;
&lt;li&gt;Supporting frame-by-frame playback so makers can inspect underlay order and trim jumps before exporting to &lt;code&gt;.PES&lt;/code&gt;, &lt;code&gt;.DST&lt;/code&gt;, &lt;code&gt;.JEF&lt;/code&gt;, &lt;code&gt;.EXP&lt;/code&gt;, or &lt;code&gt;.VP3&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you want to inspect an existing &lt;code&gt;.PES&lt;/code&gt; or &lt;code&gt;.DST&lt;/code&gt; file's stitch count, hoop bounds, and trajectory directly in your browser without installing desktop software, try the free online viewer at &lt;a href="https://imagetopes.com/pes-file-viewer" rel="noopener noreferrer"&gt;imagetopes.com/pes-file-viewer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>webdev</category>
      <category>canvas</category>
      <category>binary</category>
    </item>
  </channel>
</rss>
