FCS Image Rendering & Display Settings

Extracted from the fcs-HBC-2-tacr production codebase (Outputs/, AnalysisSocket/).


1. Fcs.Presentation.ImageRenderer

The core class for rendering 3D FCS models to images:

imageRenderer := Fcs.Presentation.ImageRenderer{
   Model                    = someGclass,              # the FCS model/gclass to render
   DrawSettingsFile         = "path/to/settings.fcsdrs",  # rendering style JSON
   ProjectionSettingsFile   = "path/to/view.fcsdrv",      # camera/projection JSON
   AutoZoom                 = True,                    # auto-fit to content
   ComputePolygonVisibility = True,                    # z-buffer for 3D solids (optional)
}

Using in a Report Image

image := Fcs.Reporting.Image{
   ImageContent := imageRenderer,
   Title        := "3D Model View",
   HtmlStyle    := "width:100%",     # optional CSS
}

Direct CLI Rendering

fli_image imageRenderer

Path Resolution

Use res.GetFileNamePath("filename.fcsdrs") to resolve a path relative to the current FCS file's directory:

DrawSettingsFile       = res.GetFileNamePath("PrimaryFrame.fcsdrs"),
ProjectionSettingsFile = res.GetFileNamePath("XYPlanePicture.fcsdrv"),

2. .fcsdrs — Draw Settings File

Format: Single-line JSON
Controls: Colors, pen widths, label styles, visibility of model elements

For material appearance that should travel with the model, prefer inline layer materials:

layer {paintedSteel} color LightSteelBlue material {
    SurfaceColor := {R := 0.62, G := 0.68, B := 0.74},
    Roughness := 0.42,
    Metalness := 0.65,
    Side := "Front"
}

Layer materials are exported into scene materialData and work without .fcsdrs. Use .fcsdrs mainly for visibility, camera-independent draw style, labels, meshes, and result-display settings. See 26-MATERIAL-VISUALIZATION.md.

Top-Level JSON Structure

{
  "Environment": {
    "grdBot":  { "knownColor": 164 },
    "grdDraw": true,
    "grdTop":  { "knownColor": 164 },
    "light1":  { "ColorAmbient": {...}, "ColorDiffuse": {...}, "Light": 1,
                 "Position": {"x": -1, "y": -1, "z": 1} },
    "light2":  { ... },
    "lights":  true
  },
  "Palette":   { "font": {"ffam": "Arial Narrow", "size": 8}, "maxV": 1, "minV": 0,
                 "steps": 20, "visible": true },
  "WorkPlane": { "draw_axes": true, "draw_grid": true },
  "assemblyDraw":     false,
  "deformationScale": 10,
  "drawGeometry":     true,
  "draw_boudarycond": true,
  "draw_mesh":        false,

  "geometry_curves":        { "visible": true,  "brushColorBy": 2, "normalPen": {...} },
  "geometry_vertices":      { "visible": false },
  "geometry_solids":        { "visible": true,  "brushColorBy": 2 },
  "geometry_labels":        { "visible": true },
  "geometry_areas":         { "visible": false },
  "geometry_gblocks":       { "visible": true },
  "geometry_distributions": { "visible": true },

  "mech_beams":    { "visible": false, "displaySurface": true, "displaySystemLine": false, "result": 44 },
  "mech_load":     { "visible": true,  "sizeScale": 1, "loadScale": 1 },
  "mech_supp":     { "visible": true,  "MarkSize": 0.1 },
  "mech_sections": { "visible": true },
  "mech_planes":   { "visible": true },
  "mech_plates":   { "visible": true },

  "result_field": { "visible": true }
}

Key Visibility Flags

Setting Controls
geometry_curves.visible Line / curve display
geometry_vertices.visible Vertex point markers
geometry_solids.visible 3D solid surfaces
geometry_labels.visible Text label display
mech_beams.visible Beam element display
mech_load.visible Load arrow display
mech_supp.visible Support symbol display
draw_boudarycond Boundary condition symbols
draw_mesh FEM mesh display

Coloring Modes (brushColorBy)

Value Effect
0 Uniform color (from normalBrush)
2 Color by layer

Common Named Settings Files (HBC-2)

File Purpose
DrawSettings.fcsdrs General building view
PrimaryFrame.fcsdrs Primary frame detail
Gray.fcsdrs Grayscale walls / surroundings
Dimensions.fcsdrs Dimension line style
ReportBomItemPicture.fcsdrs BOM item rendering
SecondaryStructureRoofDrawing.fcsdrs Roof secondary structure

3. .fcsdrv — Projection / View Settings File

Format: Single-line JSON
Controls: Camera position, projection type, zoom, image size

JSON Structure

{
  "anizotropicZoom":   false,
  "applySceneCutting": false,
  "aspectRatio":       1,
  "autoFit":           true,
  "cutPlaneFar":       1000,
  "cutPlaneNear":      0.1,
  "focusDistance":     1,
  "imageDpi":          72,
  "isPerspective":     false,

  "layersVisibility": {
    "implicitVisibility": true,
    "list": []
  },

  "mOrigin":    { "x": 5.17,  "y": 7.45,  "z": 3.76 },
  "mShiftView": { "x": -206.15, "y": 6.21 },
  "mViewAhead": { "x": -0.526, "y": 0.677,  "z": -0.515 },
  "mViewRight": { "x":  0.790, "y": 0.613,  "z": 0 },
  "mViewUp":    { "x": -0.316, "y": 0.407,  "z": 0.857 },
  "mZoomX": 31.9,
  "mZoomY": 31.9,

  "perfMaxTesselPoints": 70,
  "perspectiveAngle":    10,

  "sceneCutShape": {
    "bbox": { "Coords": [{"Max": 1, "Min": -1}, {"Max": 10, "Min": -10}, {"Max": 10, "Min": -10}] },
    "lcs":  { "origin": {"x": 0, "y": 0, "z": 0}, "axes": {"X": {"x": 1, "y": 0, "z": 0}} }
  },

  "sizeAutoToScreen": true,
  "textDpi":          72,
  "visibilityStyle":  0,
  "xSize":            2000,
  "ySize":            1302
}

Key Fields

Field Purpose
isPerspective false = orthographic, true = perspective
mOrigin Camera look-at point in world coordinates
mViewAhead Camera direction vector (normalized)
mViewRight Camera right vector (normalized)
mViewUp Camera up vector (normalized)
mZoomX, mZoomY Zoom level
mShiftView 2D pan offset in screen coordinates
autoFit Auto-fit model to viewport (overrides zoom)
xSize, ySize Output image dimensions in pixels
imageDpi Resolution in dots per inch
layersVisibility Layer visibility overrides
sceneCutShape Clipping box for section cuts

Common Named View Files (HBC-2)

File Purpose
ReportModels.fcsdrv General 3D isometric view
XYPlanePicture.fcsdrv Top-down XY plan view
ReportBomItemPicture.fcsdrv Item detail view
ReportOpeningBomItemPicture.fcsdrv Opening detail
ReportPanelBomItemPicture.fcsdrv Panel detail

4. Quick Reference

# Define a renderer
renderer := Fcs.Presentation.ImageRenderer{
   Model                    = myModel,
   DrawSettingsFile         = res.GetFileNamePath("DrawSettings.fcsdrs"),
   ProjectionSettingsFile   = res.GetFileNamePath("ReportModels.fcsdrv"),
   AutoZoom                 = True,
}

# Wrap in a report image
img := Fcs.Reporting.Image{
   ImageContent := renderer,
   Title        := "Figure 1 – Overview",
   HtmlStyle    := "width:80%",
}

# CLI render to file
fli_image renderer