CTS CNC Pattern Pro V1.0.0
Author: CAD Tools Studio
Website: https://www.cadtoolsstudio.com/

Install the RBZ with SketchUp > Extensions > Extension Manager > Install Extension.
Restart SketchUp after replacing an older version to unload its previous Ruby callbacks.

Compact resizable window:
- Opens at 340 x 480; resize from any window edge/corner, down to 260 x 220.
- Controls rearrange to the available width; scroll settings in shorter windows.
- Category tabs, Edit Selected CNC and bottom actions remain accessible.
- Category changes and Edit keep the chosen size. Window placement/size is saved.
- Version reset to 1.0.0 as requested; all earlier geometry/camera fixes retained.

Previous camera/layout fixes:
- Image Preview targets only the design in perspective and retains your current
  camera angle. Other model geometry no longer affects its framing.
- Parametric hides preview counters and uses compact full-width output rows.

V1.0.11 Image workflow:
1. Load Image.
2. Choose Normal or Complex. Complex keeps finer boundary detail.
3. Preview. Green stays; red is cut away. Click a region to change its role.
4. If needed, set one gap tolerance in the chosen output unit and Close Mini Gaps.
5. Set output units, width/length and optional thickness. One dimension keeps aspect.
6. Convert.

Curves are fitted as cubic Bezier paths and sampled adaptively for SketchUp.
SketchUp is a surface modeler: native curves/faces still use edge segments.
The fitted control paths are retained; native boundary curves and smooth curved
side normals avoid the previous excessive pixel staircase geometry.
Blurry input is estimated mathematically; detail absent from the original cannot
be recovered with guaranteed accuracy. Review fine corners before machining.

Edit an existing CNC:
- Select its group/component and click Edit Selected CNC from any category.
- Change settings, Preview, then Update CNC. The same selected entity is updated.
- Exit Edit/Cancel restores the original; updates do not leave a second result.
- New results keep full settings, sources, masks and region choices. CAD editing
  still needs its source CAD file. Small image sources are embedded for re-tracing.
- Results created before saved-settings support can edit dimensions from their
  existing geometry; unavailable original pattern parameters cannot be reconstructed.
- Component edits affect only the selected instance. Existing instance placement,
  name, tag and group material are retained.

V1.0.10 Faster previews in all four tools:
- Image: Preview draws outlines without native edge creation. Create Face shows
  the selectable color preview; Apply builds the final native faces/extrusion.
- Jali/Complex include the green sheet and red cutouts. The selected boundary
  quality is retained. Max still takes longer to trace than Fast on dense images.
- Apply builds kept regions directly with their hole boundaries. A panel can
  require one sheet face instead of hundreds of temporary cutout faces.
- Keep Outlines explicitly creates real SketchUp edges for independent editing.
  Repair actions may also create editable edges and require native face recovery.
- Seamless and Parametric cache pattern data and viewport draw geometry; changes
  to settings, sources, targets or masks refresh it. Click edits keep working.
- CAD live resizing/repeats reuse the imported geometry and cached array bounds.
- Repeated redraws do not retrace the image or rebuild unchanged pattern points.
- Cancel during final image building preserves the source outlines. Native
  recovery that changes the regions returns to review instead of silently Apply.
- Desktop SketchUp geometry/performance testing is still required. Initial file
  decoding/tracing, CAD import, large masks and final native operations can take
  longer than a fraction of a second; no universal 0.01-second claim is made.

V1.0.9 Image panel and colors:
- For sheet patterns use Image > Jali or Complex; Include image panel is enabled.
- Preview > Create Face shows the sheet GREEN and enclosed cutouts RED.
- Apply deletes red regions and keeps the sheet. Review the regions first.
- Logo mode leaves the panel off; the toggle is available for raster images.
- Disable the panel when separate solid artwork is intended.
- Re-preview after changing panel/preset settings; existing face previews must
  be cancelled before retracing.

V1.0.8 Deleted-group fix:
- Corrected the temporary group being purged before its first image face batch.
- A hidden construction point keeps the group alive through creation/fallback.
- The point is removed before the finished colored preview is published.
- No extra construction point remains in the CNC result.

V1.0.7 Image lifecycle and complex design support:
- Image > Complex selects Max detail at 3000px trace resolution.
- Preview creates vector outlines. Create Face starts the colored CNC preview.
- A region counter shows construction progress. Cancel stops the build and keeps
  the original outlines. Apply becomes available after a valid face preview exists.
- Large/intersecting traces use batches between regions, retaining all traced detail.
- Do not change the active model/editing context while a build is running.
- One especially complex native face can still take longer within its batch.
- Replacing an image clears the old Apply token. New outlines show Create Face.
- On a geometry error, outlines remain available for Close/Join/Simplify repairs.
- Native SketchUp geometry and timing are not available in this build environment.

V1.0.6 Image Speed:
- Select Image, choose the source, then Preview and Create Face.
- Fast is the default: 1000px maximum trace size, fewer curve points.
- High/Max preserve finer detail at higher computation cost.
- SketchUp 2022+ uses a bulk face builder with explicit inner loops.
- Raster region detection no longer calls find_faces on every edge.
- The interactive Create Face path uses batched native processing for intersecting
  or dense traces; invalid geometry remains available as outlines for repair.
- Changing image output size/thickness does not rerun the tracer.
- Actual native face-build time is shown in the preview message.
- 0.01 seconds is not guaranteed. Native geometry speed depends on SketchUp,
  the image detail and the machine. Build tests do not run desktop SketchUp.

V1.0.5 import fix:
- Corrected camera framing that caused the V1.0.4 CAD preview to disappear.
- Camera commands cannot delete valid imported geometry when framing fails.
- First import, repeat preview and camera-failure contracts are regression tested.

CAD workflow:
1. Browse to DWG/DXF and click Preview.
2. Choose which regions to remove using Delete Red/Delete Green or Pick Regions.
3. Edit output width/length, thickness, XYZ counts and gaps freely.
   Existing CAD geometry is reused; edits do not re-import the file.
4. Apply creates the final result and closes the active preview.
   Apply reads the latest field values even before a pending live update.
5. The result reports actual Apply time in milliseconds.

Repeat preview:
- The first tile remains colored and selectable.
- Smaller repeats show orange outlines. Dense repeats show boxes.
- Above 250 repeats, one overall envelope avoids drawing thousands of tiles.
- Final output always uses the validated full counts, up to the edition limit.
- Z repetition requires thickness or a nonzero Z gap.
- Negative thickness and negative gaps are supported.
- Repeats are lightweight instances sharing a single generated definition.

Performance:
- Size changes use display transformations and cached repeat outlines.
- Clean flat unpainted, single-tag CAD panels use a welded bulk extrusion mesh.
- Source face triangulation preserves holes; boundaries receive side walls.
- A closed-solid check must pass before replacing the source geometry.
- Painted, multi-tag, loose-edge or non-planar sources use native extrusion.
- Calculation time depends on source geometry and the SketchUp host.
  A fixed few-millisecond completion time is not guaranteed.

Compact interface:
- 570 x 700 default dialog, smaller section spacing, 26px controls.
- XYZ counts and XYZ gaps each occupy one row at normal dialog width.
- Region filters/layers/diagnostics and import options are collapsible.
- Smoothing controls appear only when smoothing is enabled.
- Gap repair/tolerance apply at initial import; change them before importing.

Validation:
Ruby syntax, isolated geometry logic and HTML/JavaScript workflow checks.
SketchUp itself is not available in the build environment. Check native import,
face generation and real performance in SketchUp 2024 before production use.

Suggested check: import the original DXF, preview 3 x 2 x 1, resize to
2500 x 1200, set thickness 8, then Apply immediately after another count edit.
Only the final model should remain. Also test Cancel and positive/negative
thickness. Start these checks in a fresh model to exclude old V1.0.3 previews.
