Juniper - First Graphic - Grit Tank - Postgresql Documentation

Date: 2025 09-September 17

Based on the sensor data you've provided, the grit tank is an excellent choice for the first graphic. It is simple enough to demonstrate the pipeline's core functionality, but complex enough to be visually interesting and valuable to an operator.

This graphic will be the perfect "quick win" for the project. It focuses on the most critical part of the Juniper pipeline: the translation of a few, simple components with a clear visual state.

This graphic demonstrates the full end-to-end pipeline: from a Blender model to a data-rich, interactive web graphic, which can then be translated into an Ovation source file.

Database Plan for Document Tracking

Your idea to use PostgreSQL for a stable record is excellent. It will be the "source of truth" for the project's metadata. A simple schema with three tables will be sufficient to track which documents are used for which graphics.

  1. graphics Table

This table will store metadata about the generated Ovation graphic.

  1. documents Table

This table will store metadata about the source documents used for the graphics.

  1. graphic_documents Table

This is a join table that links graphics to the documents used to create them.

This design is simple, scalable, and directly addresses the need to track your source materials. The graphic_documents table provides a clear, verifiable record of where every component in the final Ovation graphic originated.

Three Views

Building on the previous plan, generating three separate, redundant graphics for the grit tank is an excellent idea. This approach provides a robust first demo by proving that the pipeline can handle different camera angles and visual styles from the same source data. It also allows you to showcase the project's flexibility.

The Three Graphics for the Grit Tank

1. Top-Down View

2. Side View / Cross-Sectional View

3. Isometric View

By creating these three graphics, you can showcase how the same underlying data can be presented in multiple ways, each serving a different purpose. This directly addresses the needs of upper management (efficiency), engineers (technical accuracy), and operators (situational awareness).


Tip to Tail

1. Codebase for View Generation

The rotation and geometry for each view will be handled by the front-end renderer (3_svg_renderer.js) and not by the backend Python scripts.

This separation of concerns is a core tenet of the pipeline. The backend handles the data, and the frontend handles the visual representation.

2. How this Leverages DRY Principles

This architecture leverages the "Don't Repeat Yourself" (DRY) principle by ensuring that the core data processing logic is written only once.

By separating the data from its visual representation, you prevent the need to replicate code across different scripts or files.

3. The Full Pipeline Flow

This is a comprehensive breakdown of the entire data flow, from the initial inputs to the final Ovation graphic.

Inputs:

Intermediate Steps:

  1. The Extractor (1_asset_extractor.py):

    • Input: The raw CAD/GIS assets and Ovation point list.

    • Process: The script parses the CAD file, extracting all geometric shapes (lines, polygons, etc.) and their coordinates. It cross-references the shapes with the Ovation point list based on asset ID or description, creating a link between a visual component and a data point.

    • Output: The intermediate JSON file. This is the heart of the pipeline. It contains a list of every geometric element, its type (e.g., 'polygon', 'circle'), its canonical coordinates, and a metadata object that links it to its corresponding Ovation point (IESS, SID, DESC).

  2. The Renderer (3_svg_renderer.js):

    • Input: The intermediate JSON file.

    • Process: This is a client-side JavaScript component. It reads the JSON file and, using the D3.js library, renders the geometry as an SVG. This is where you apply the specific transformations for the top, side, and isometric views. It generates a separate .svg file for each view. This step is purely for visual validation and designer-friendly development.

    • Output: Three separate .svg files: grit_tank_top.svg, grit_tank_side.svg, and grit_tank_iso.svg.

  3. The Translator (2_svg_to_ovation_translator.py):

    • Input: The .svg files generated in the previous step.

    • Process: This Python script reads the .svg files and parses their elements. It uses a transformation function to scale the SVG coordinates to the Ovation grid (e.g., 800x600 SVG to 16384x16384 Ovation grid). It then uses the metadata embedded in the SVG (or re-references the original JSON) to generate the Ovation-specific commands for each graphical object. This includes defining colors, text, and data-links to the Ovation points.

    • Output: Three separate, human-readable Ovation .src files: grit_tank_top.src, grit_tank_side.src, and grit_tank_iso.src.

Final Step:

  1. Ovation Compiler:

    • Input: The .src files.

    • Process: A separate, proprietary Ovation tool compiles the .src file into a .diag file that can be viewed and used on an operator station.