ResInsight icon indicating copy to clipboard operation
ResInsight copied to clipboard

grpc: Add extraction of surface geometry and intersection geometry

Open magnesj opened this issue 1 year ago • 0 comments

The WebViz project want to use ResInsight to extract selected geometry structures from 3D grid models. The following functionality is requested:

  • based on a cell filter, extract the polygons for visible cell surfaces and their corresponding global cell ID
  • based on a polyline, create a vertical fence and extract geometry along this fence

Suggested service API

  • create a new proto file for these two operations GridGeometryExtraction.proto
  • create a file VectorDefines.proto and move Vec3d from Defines.proto into this file. Add Vec2d.
  • use the automation in ResInsight to compile the proto files for C++ and Python
  • add service similar to RiaGrpcProjectService
  • this API is intended to be used directly based on the proto definition, potentially from Go. Do not create additional Python code as other classes used by ResInsight has.

Workflow in ResInsight

When message is received from client

  • open the grid
  • create a view
  • populate view with requested cell filters or intersection geometry
  • produce geometry
  • close down view, but keep grid model loaded Send response to client

Grid surface geometry

Investigate existing solution in ResInsight and consider how to access this information. Relevant classes are StructGridGeometryGenerator and RivGridPartMgr

Extraction of geometry based on a polyline

Investigate existing solution in ResInsight and consider how to access this information. Relevant classes are RivExtrudedCurveIntersectionGeometryGenerator

Access this generator from RimExtrudedCurveIntersection::intersectionGeometryGenerator

Development comments

Import of a grid model is a heavy job. Investigate how the grid can be reused between requests, consider eviction of loaded grids based on a count threshold and least recently used concept.

Example of import of model with only grid RicfLoadCase::execute()

Creation of a view and cell filters are considered lightweight and views can be deleted after use.

First prototype

  • create a mock model using RiaApplication::createMockModel()
  • extract geometry using m_vertices in StructGridGeometryGenerator
  • send surface geometry to GRPC
  • use Plotly to investigate the generated geometry https://plotly.com/python/3d-mesh/

Other references

Prototyping of well path extraction data to WebViz using Plotly https://github.com/equinor/webviz-subsurface/compare/master...magnesj:webviz-subsurface:ri-prototype-intersection

magnesj avatar Feb 14 '24 08:02 magnesj