Skip to content

SoilFoundationPlotter

SoilFoundationPlotter

SoilFoundationPlotter(structure_info: Optional[dict] = None, soil_info: Optional[dict] = None, foundation_info: Optional[dict] = None, pile_info: Optional[dict] = None, info_file: Optional[str] = None, server_name: str = 'soil_foundation_plotter', port: int = 8080, title: str = 'Soil/Foundation Plotter')

Browser-based GUI for fast visualization of soil layers, foundation blocks, and piles using PyVista + trame. Based on reliable patterns from test.py.

Attributes

pv instance-attribute

pv = pyvista

title instance-attribute

title = title

port instance-attribute

port = port

_actual_soil instance-attribute

_actual_soil = None

_actual_pile instance-attribute

_actual_pile = None

_actual_foundation instance-attribute

_actual_foundation = None

_scalars instance-attribute

_scalars = ['Mesh', 'Core', 'Region', 'ElementTag', 'MaterialTag']

_discretized_exists instance-attribute

_discretized_exists = False

_axes_actor instance-attribute

_axes_actor = None

_grid_actor instance-attribute

_grid_actor = None

_mesh_file instance-attribute

_mesh_file = mesh_file

plotter instance-attribute

plotter = Plotter(off_screen=True, notebook=False, window_size=(1000, 700))

objects instance-attribute

objects = {}

state_defaults instance-attribute

state_defaults = {'show_soil': True, 'soil_opacity': 0.35, 'show_foundation': True, 'foundation_opacity': 0.55, 'show_piles': True, 'piles_opacity': 1.0, 'show_mesh': bool(mesh_file), 'mesh_opacity': 1.0, 'discretized': _discretized_exists, 'show_axes': False, 'show_grid': False, 'selected_scalar': 'Mesh'}

Methods:

_setup_server

_setup_server(server_name: str)

Setup the trame server and UI

quick_plot

quick_plot() -> None

Fast scene build: soil/foundation as boxes, piles as cylinders.

_add_soil_layers

_add_soil_layers()

Add soil layers to the scene

_add_foundation_blocks

_add_foundation_blocks()

Add foundation blocks to the scene

_add_piles

_add_piles()

Add piles to the scene (supports single and grid definitions)

_add_pile_grid

_add_pile_grid(pile, pidx)

Add a grid of piles

_add_single_pile

_add_single_pile(pile, pidx)

Add a single pile

_add_mesh_file

_add_mesh_file()

Add mesh file to the scene

clear_all

clear_all()

Clear all objects from the plotter

reset_camera

reset_camera()

Reset the camera to default position

_apply_visibility

_apply_visibility()

Apply visibility settings based on current state

_apply_opacity

_apply_opacity()

Apply opacity settings based on current state

update_view

update_view()

Update the 3D view

_load_infos

_load_infos(structure_info: Optional[dict], soil_info: Optional[dict], foundation_info: Optional[dict], pile_info: Optional[dict], info_file: Optional[str])

Load configuration from file or use provided dicts

start_server

start_server(**kwargs)

Start the trame server

get_object_list

get_object_list()

Get a list of all objects in the scene

get_object_info

get_object_info(name)

Get information about a specific object

remove_object

remove_object(name)

Remove a specific object by name

actual_plot

actual_plot(scalar=None)

Build and render the actual meshes returned by the model builder.

_compute_actual_meshes

_compute_actual_meshes()

Compute the actual meshes using the model builder.

_check_discretized_exists

_check_discretized_exists() -> bool

Check if meshes are cached in memory (no disk).

_save_discretized

_save_discretized(pile_mesh, foundation_mesh, soil_mesh)

No-op: we keep meshes in memory only based on user request.

_load_discretized

_load_discretized()

Return already-cached meshes from memory.

discretize_and_save

discretize_and_save()

One-time discretization: compute and cache in memory, then disable the button forever.