.. index:: single: Point Cloud Sections and Sheets single: Point Cloud Sections single: Sheets Point Cloud Sections and Sheets =============================== .. index:: single: Point Cloud Sections Point Cloud Sections -------------------- The point cloud section editor cuts arbitrary 2D sections out of a loaded point cloud — vertical (façade / wall elevation cuts) or horizontal (floor plan slices). Sections are persistent CAD entities with grips; each can be opened in its own floating viewer, line-traced into polylines, and committed back to the drawing as flat 2D geometry ready for plotting. Workflow ~~~~~~~~ 1. **Create** the section — :command:`PCSECTION` (alias :command:`PCS`). Pick *Vertical* or *Horizontal*, then the geometry: - **Vertical**: two plan points define the cut line and view direction; slab thickness controls the depth of points to include either side of the plane. Z range can be auto-derived from the cloud bounds or set manually. - **Horizontal**: an elevation point (or typed Z value) plus two plan corners give a horizontal slab at that elevation. The section appears in the drawing as a translucent rectangle with grips at its corners and a thickness arrow. Drag the grips in plan to move or resize the cut; drag the thickness arrow to thicken or thin the slab. 2. **View** the section — :command:`PCSECTIONVIEW` (alias :command:`PCSV`). A floating viewer opens with the projected points in the cutting plane's local coordinates. Pan with the middle mouse button, zoom with the wheel. The viewer auto-refreshes whenever the underlying section's geometry or thickness changes — drag a grip in the main canvas and the viewer updates immediately. 3. **Trace** straight lines through the points — :command:`PCSECTIONTRACE` (alias :command:`PCST`), or click **Trace** in the viewer toolbar. Two modes: - **Simple** — clusters connected points and fits each cluster with a polyline (PCA + Douglas-Peucker simplification). Good for clean wall scans regardless of orientation. - **Manhattan** — the Simple pipeline plus a final pass that snaps near-orthogonal segments to the dominant axis. Use this when the building is mostly orthogonal in plan (most are); curved walls and deliberately diagonal walls are left untouched. Toggle in the viewer by clicking the **Snap** button before pressing **Trace**. Tolerance defaults to 2 cm (the polyline simplification threshold) — tighten for finer detail, loosen for cleaner output. The trace result overlays in the viewer in blue. 4. **Commit** the section to the drawing — :command:`PCSECTIONCOMMIT` (alias :command:`PCSC`). Pick a section entity, then an insertion point in model space, type a rotation angle (default 0°), and choose whether to add a section-name label. The traced polylines drop in flattened to the XY plane at the insertion point, ready to be dimensioned, hatched, or plotted. Re-running :command:`PCSECTIONCOMMIT` produces an independent copy each time — committed geometry does **not** auto-update if the source section changes. Re-commit if you want refreshed output. .. index:: single: Tips Tips ~~~~ - Multiple sections can coexist in one drawing. Each remembers its own trace mode, tolerance, and last-computed polylines. - Sections persist across save/reload via IQML. The trace cache is recomputed on demand and is not saved to file. - Use the section's **Properties** panel (Object Inspector) to fine-tune slab thickness, trace tolerance, Manhattan-snap angle, or the maximum point cap for the viewer (default 500 000 — uniform-stride sample is used if the slab exceeds this). - For multi-story buildings, copy a horizontal section and edit its elevation property to produce floor plans at every level. A dedicated batch command is planned for a future release. .. index:: single: Point Cloud Sections Along Alignment Point Cloud Sections Along Alignment ------------------------------------ A modeless viewer that generates a series of point-cloud cross-sections along an alignment at regular chainages, then drops them onto a grid **Section Sheet** ready for plotting. This is the alignment-driven counterpart to the single-section :command:`PCSECTION` workflow above. The standalone *Tunnel Section Viewer* has been retired; all its capabilities — angular-bin filtering, plane-mode toggle, and tunnel section placement — are now native to this viewer under the **Tunnel** radio button. Launched from **Civil → Point Cloud Sections Along Alignment** or by typing :command:`PCSECTIONS` (alias :command:`PCSS`) at the command line. **Workflow:** 1. **Pick alignment** from the top combo box. 2. **Pick a point cloud** from the cloud combo box. 3. **Choose a mode:** - **Ground** — planimetric slab filter (lateral width, elevation band, percentile / mode pick rule, gap fill). Use for road, rail and surface scans. - **Tunnel** — angular-bin filter around the alignment center. Converts each point to polar coordinates (angle, radius) from the alignment axis, divides them into angular bins, and selects one representative point per bin. Use for tunnels and other tubular geometries. See the Tunnel Filter Panel subsection below for the eleven filter controls. 4. **Generate stations** — set start / end / step (and optionally *Include PIs*) and press **Generate** to populate the station list, or add stations manually with the **+/-** buttons. 5. **Preview** any station in the centre paint box; **Prev / Next** walk through the list. 6. **Place sections** in the drawing: - In **Ground** mode each station becomes a ``TAECC_PointCloudSection`` entity. - In **Tunnel** mode each station becomes a ``TAECC_TunnelSectionLine`` entity (the same entity type produced by the retired standalone viewer). 7. **Generate sheet…** — see below. .. index:: single: Toolbar Controls Toolbar Controls ~~~~~~~~~~~~~~~~ Two shared controls appear on the viewer toolbar regardless of mode: - **Plane** combo (**Vertical** / **Perpendicular**) — selects how the cutting plane is oriented at each station. *Vertical* uses a plane perpendicular to the horizontal alignment projection (standard civil cross-section). *Perpendicular* tilts the plane to be truly perpendicular to the 3D alignment tangent, accounting for vertical grade — most useful for steep tunnel grades (>5 %). In Ground mode the Perpendicular option is not yet fully implemented: the viewer shows a warning and falls back to the vertical slice. - **Absolute Z** checkbox — when unchecked (default) the vertical axis shows ΔZ relative to the alignment centre line. Checking it switches to absolute world Z. Toggling this control does not recompute the point data; it repaints instantly and resets the pan/zoom so the new extents are fully visible. .. index:: single: Axis Info Strip Axis Info Strip ~~~~~~~~~~~~~~~ Above the station slider a six-cell strip shows alignment data at the active station: **X**, **Y**, **Z** (world coordinates of the alignment at that chainage), **Dir** (azimuth in degrees), **Grade** (%), and **R** (radius of curvature, metres; blank on straight sections). The strip updates every time the station changes. .. index:: single: Slab Thickness (shared) Slab Thickness (shared) ~~~~~~~~~~~~~~~~~~~~~~~ Above both filter panels sits a single **Slab thickness** spin edit (default 0.5 m, range 0.05–10 m). It controls the depth of the slab of points the extractor considers for the section: points within ± half-thickness of the cutting plane are kept. Thicker slabs include more raw points — the trace is more robust against sparse scans — at the cost of smearing longitudinal detail. The control is shared between Ground and Tunnel modes. .. index:: single: Ground Filter Panel Ground Filter Panel ~~~~~~~~~~~~~~~~~~~ When **Ground** mode is selected the filter panel exposes seven controls. Ground extraction projects raw slab points onto the section plane (lateral offset *U*, elevation *V*), then sweeps lateral bins across the width and picks one *V* value per bin via a configurable percentile. Use this for road, rail, ground-surface or façade scans where a top-of-points profile is wanted. .. list-table:: Ground Filter Parameters :header-rows: 1 * - Parameter - Default - Description * - Lateral width - 30 m - Total extent of the bin sweep across the section, centred on the alignment centre line (e.g. 30 m = ±15 m). Points beyond this lateral range are discarded before binning. * - Bin size - 0.5 m - Width of each lateral bin in metres. Smaller = more polyline vertices and tighter following of the surface; larger = a smoother, simpler polyline. * - Elev below - 3 m - Maximum metres below the alignment centre line to consider. Points lower than this are discarded before binning — keeps the slab clean of below-grade clutter. * - Elev above - 5 m - Maximum metres above the alignment centre line to consider. Clips out vegetation, overhead structures, or scan returns from above the surface. * - Pick - Top points - Quick preset combo that drives the **Percentile** value: *Top points* (95 %), *Middle points* (50 %), *Bottom points* (5 %). Adjust **Percentile** manually for any other value. * - Percentile - 95 - The percentile of the per-bin Y values that becomes the output vertex (0–100). 95 is the canonical *top of points* value; 50 picks the median; 5 picks the floor. * - Gap fill - 2 m - Bridges short empty runs in the bin sweep. When the next non-empty bin sits within this many metres of the last emitted vertex, intermediate empty bins are linearly interpolated; longer gaps leave a discontinuity in the polyline so missing-data regions remain visible. The algorithm is a single pass: (1) clip points to the lateral and elevation windows, (2) bin them along the lateral axis, (3) sort each bin's Y values ascending and take the configured percentile, (4) emit one vertex per non-empty bin at *(bin centre X, percentile Y)*, (5) bridge short empty runs via linear interpolation. The filtered ground polyline is rendered with the same 3-pass styling as the tunnel trace: black outline (width 5), white line (width 2), green vertex dots (radius 3). .. index:: single: Tunnel Filter Panel Tunnel Filter Panel ~~~~~~~~~~~~~~~~~~~ When **Tunnel** mode is selected the filter panel exposes eleven controls: .. list-table:: Tunnel Filter Parameters :header-rows: 1 * - Parameter - Default - Description * - Mode - Outermost - Selection rule per bin: **Outermost** (excavation surface), **Innermost** (lining), **Median** (robust), **Percentile** (configurable) * - Bin - 5 deg - Angular bin width (2–15 deg). Smaller = more polyline vertices. * - MinR / MaxR - 0 / 15 m - Radius cutoff from alignment center. Excludes noise and over-range points. * - MinPts - 3 - Minimum points per bin; bins with fewer points are skipped. * - Pct - 90 % - Percentile value (active only in Percentile mode). * - Prox - 100 % - Plane proximity — percentage of closest-to-chainage points to keep per bin. At 100 % all slab points are used; lower values keep only points nearest the exact cutting plane. * - Inv.Skip - 0 deg - Invert skip — excludes an angular zone at the bottom (tunnel floor). A shaded wedge labelled "SKIP" is drawn in the viewer. * - MinElev / MaxElev - -999 / +999 m - Elevation cutoffs relative to the alignment center. A dashed line is drawn in the viewer at each active cutoff level. * - Gap - 0 m - Radial gap threshold per bin. When the gap between consecutive points exceeds this value, inner points (ducts, cable trays, equipment) are removed, keeping the outer cluster (rock surface). Set to 0 to disable. The filtered result is rendered with 3-pass styling: black outline (width 5), white line (width 2), green vertex dots (radius 3). .. index:: single: Generating a Section Sheet Generating a Section Sheet ~~~~~~~~~~~~~~~~~~~~~~~~~~ Pressing **Generate sheet…** hides the viewer and switches the main canvas into a one-shot pick mode (status bar prompt *"Pick insertion point (Esc to cancel):"*). Left-click anywhere in the drawing — object snap is honoured, so endpoint / midpoint / intersection snaps work for placement. The viewer reappears and a ``TAECC_PointCloudSectionSheet`` entity is added at the picked point, laying the placed sections out in a 4-column grid (rows are computed as ``ceil(count / 4)``; cell width and height are derived from the filter's lateral-width setting). Press **Esc** or **right-click** on the canvas to cancel — the viewer reappears with a *"Sheet generation cancelled."* message and no sheet is added. Closing the viewer mid-pick (e.g. from the taskbar) is also safe; any pending pick is dropped. The sheet entity carries a **SheetKind** discriminator (Ground or Tunnel) that controls how cells are rendered and updated. Ground sheets store the ``TAECC_PointCloudSection`` handles; tunnel sheets store the ``TAECC_TunnelSectionLine`` handles plus the eleven tunnel filter parameters. Tunnel cell thumbnails are rendered using a PCA-derived local frame so the cross-section profile fills the cell correctly. Both kinds round-trip through IQML and the compact streaming format; legacy IQZ files load as Ground. The Object Inspector shows a read-only **SheetKind** field under the **Source** category. The **Re-sample** action (Properties pane) re-fits every section in the sheet from scratch, using the stored filter parameters for tunnel sheets. The sheet entity exposes its grid (Columns, Rows, Cell Width / Height, H/V Spacing), insertion point and label format in the Object Inspector under the **Layout**, **Position** and **Display** categories, and the linked alignment and section handles under **Source**. When a sheet is generated, it is placed on the civil-default layer ``C-PCSC-{Name}`` (yellow by default, see :doc:`/parts/command_reference/03_defaults`). All visual elements painted by the sheet — frame, axis guides, trace polylines and labels — default to **ByLayer** in the sheet style, so the entire sheet inherits that layer's colour until you override individual elements via the style editor below. .. index:: single: Point Cloud Section Sheet Styles Point Cloud Section Sheet Styles -------------------------------- Every ``TAECC_PointCloudSectionSheet`` resolves its visual appearance through a named *style entity* (``TAECCPCSectionSheetStyle``) stored in a per-drawing library on the canvas. Each drawing ships with a built-in **Standard** style that cannot be renamed or deleted; you may add, duplicate, rename or delete any other style. The sheet picks its style via the **Style** dropdown in the Object Inspector (``Identity`` category). Sheets whose ``Style`` is blank or names a missing style fall back to **Standard**. .. index:: single: Opening the Style Editor Opening the Style Editor ~~~~~~~~~~~~~~~~~~~~~~~~ Three entry points: * **Civil › Styles › PC Section Sheet Styles…** menu — launches the modal editor. * The ``PCSECTIONSHEETSTYLES`` command (alias ``PCSSS``). * **Civil › Civil Style Manager** — select the *Point Cloud Sections* node in the left tree to embed the same editor in the manager's right pane. The editor has a left strip listing every style in the canvas's library (with *New*, *Duplicate*, *Rename*, *Delete* buttons — *Standard* is protected from rename and delete) and a tabbed right panel with five tabs: **Cell**, **Axis Guides**, **Label**, **Trace** and **Preview**. .. index:: single: Editable Fields Editable Fields ~~~~~~~~~~~~~~~ .. list-table:: Cell tab :widths: 25 75 :header-rows: 1 * - Field - Meaning * - Frame visible - Toggles the rectangular cell border. * - Frame colour / weight / line style - Pen for the cell border. * - Padding top / bottom / left / right (%) - Per-side inset of the trace inside each cell, as a percentage of cell height/width. Only used when Centering is *Bounding Box*. * - Padding horizontal (%) - Symmetric horizontal inset used when Centering is *Center Line*. * - Centering - *Bounding Box* fits the trace's data extents into the cell minus per-side padding; *Center Line* centres station U=0 on the cell's vertical midline and scales symmetrically about it. * - Fill visible / Fill colour - Optional solid background colour for each cell. .. list-table:: Axis Guides tab :widths: 25 75 :header-rows: 1 * - Field - Meaning * - Vertical axis visible - Draws a dashed line at station U=0 (the alignment centreline). * - Vertical colour / weight / line style - Pen for the vertical guide. * - Horizontal axis visible - Draws a dashed line at the section's elevation centroid (tunnel cells only). * - Horizontal colour / weight / line style - Pen for the horizontal guide. .. list-table:: Label tab :widths: 25 75 :header-rows: 1 * - Field - Meaning * - Label visible - Toggles the per-cell chainage label. * - Label colour / font size (%) - Text colour and font height as a percentage of cell height (minimum 8 pixels). * - Label format - Format string with a single ``%s`` placeholder for the formatted chainage (e.g. ``STA %s`` → ``STA 0+020.000``). * - Label position - One of *Top Left / Top Center / Top Right / Bottom Left / Bottom Center / Bottom Right*. .. list-table:: Trace tab :widths: 25 75 :header-rows: 1 * - Field - Meaning * - Trace colour / weight / line style - Pen for the section profile polyline. * - Vertex dots - Draws a filled dot at every vertex of the trace polyline. * - Dot colour / radius (px) - Colour and pixel radius of those dots. The **Preview** tab paints a synthetic cell (Ground or Tunnel, set by the radio group) using the current style values, so you can see the effect of every change before committing. .. index:: single: ByLayer Colour Picker ByLayer Colour Picker ~~~~~~~~~~~~~~~~~~~~~ Every colour swatch in the editor opens a three-button dialog when clicked: **ByLayer**, **Pick Color…**, **Cancel**. Choosing *ByLayer* sets the field to the special ``clByLayer`` sentinel — the painter resolves it at draw time to the sheet entity's effective colour (layer colour or per-entity override). This is the default for every colour field in a freshly created style and matches the convention used by the other civil style editors (Tunnel Section Line, Surface, Alignment, Profile View). .. index:: single: Persistence Persistence ~~~~~~~~~~~ The library is serialised into the IQML / IQZ drawing file under the ```` element, alongside the tunnel-section-line styles and civil label styles. Sheets store only the style **name**; the resolution to a concrete style happens at draw time, so deleting a style automatically falls back to *Standard* without invalidating sheets.