Masses JSON Parser

Parses Masses JSON

JSON Masterplan (Beta) Nickname: Mass_Parser

Overview

Parses Masses JSON

Inputs (6)

  • Masses_JSON (Text): Masses JSON string
  • Filter_Building (Text): Limit by Building
  • Filter_Tower (Text): Limit by Tower ID
  • Filter_Program (Text): Limit by Program
  • ExactMatch (Boolean): Exact Match
  • Transparency (Number): Opacity 0.0 to 1.0 (Solid to Invisible)

Outputs (7)

  • Volumes (Brep): Output Volumes
  • BaseBounds (Curve): Base bounds
  • Areas (Number): Areas
  • Heights (Number): Heights
  • Colors (Colour): Colors
  • Programs (Text): Programs
  • Labels (Text): Labels

Method, assumptions and simplifications

The same notes appear in the component's Info output.

Method

  1. Parses Masses_JSON as an object of buildings, each holding a list of blocks with program, tower_id, color [r,g,b], total_height, true_z and boundary.
  2. Buildings, towers and programs are filtered by the Filter inputs: case-insensitive, exact when ExactMatch is true, otherwise substring match or wildcard match with * and ?. Empty filters keep everything.
  3. The boundary is rebuilt from Line, Arc (start, mid, end) and Polyline segments, joined with tolerance 0.01 and closed if needed (within tolerance, otherwise with a straight closing line). Blocks without a usable boundary are reported in a warning. Its area is computed before it is moved up by true_z.
  4. Each block is extruded upwards by total_height from true_z with caps into a Brep, whatever the boundary orientation. Colours get alpha = (1 − Transparency) × 255. Each block goes to branch path building index ; block index, with a label building | tower | program.

Assumptions

  • Boundaries are closed planar curves in plan, drawn at Z = 0 before the true_z shift.
  • Heights and coordinates are in model units; missing colour defaults to grey 200, missing height to 0.

Simplifications and limits

  • Blocks are straight vertical extrusions of one outline; no setbacks, floors or roof shapes.
  • If the joined segments form several pieces, only the first is used.
  • Block paths use the original block index (gaps where blocks are filtered out), while the building index counts only matching buildings.

Workflow

  • Masses JSON from the JSON masterplan engine (with colours from JSON Palette Builder) -> Masses_JSON.
  • Volumes and Colors -> Custom Preview; Areas and Heights -> area schedules.