Skip to main content

B-spline modelling CAD and meshing tools.

Project description

B-spline GEometry Modeling package

Goal: Robust open source tool for creation of parametric geometries and computational meshes via. Python code. Primary focus are hydrogeological applications with geometries including both random fractures and deterministic natural or antropogenic features.

Rationale

GMSH is a mature meshing tool providing a minimalistic API common for several languages. For Python the GMSH library and its Python API is accessible through the 'gmsh' package. However usage for practical applications is nontrivial partly due to intrinsic limitations of the underlaying OpenCASCADE library and partly due to generic API lacking the Python idioms. In particular, we have identified following sort of problems:

  • Geometry bolean operations (based on OCC) doesn't preserve "compatible" geometry, e.g. a surface separating two volumes can be duplicate, once for each volume. This produces a mesh with duplicated nodes loosing the coupling in the FEM simulations. Function for removal of duplicities is provided, but not reliable.
  • API only operates with atomic geometric entities lacking a support to organise them into logical groups, especialy after fragmenting due to bolean oeprations.
  • GMSH forms "physical groups" from the geometric entities so an entity can be part of two physical groups. That leads to duplicate elements after meshing, so we rather want "physical groups" (called "regions" for distinction) assigned to the geometric objects. We also want to preserve assigned regions during set operation if possible.
  • Consider an extracted boundary A' (e.g. for prescribing a boundary condition) of an object A. Once the object A is part of a set operation it becomes fragmented to a set B and there is no way how to get boundary corresponding to A'.
  • For thousands of "physical groups", the internal GMSH/OCC algorithms are extremaly slow (probably do to quadratic complexity).
  • The generic GMSH API is cumbersome, namely for Fields and Options.
  • For Fields related to the geometic entites these must be the final geometric entities, their fragmentation by boolean operations leads to spurious results.

BGEM tries to overcome these difficulties by two approaches:

  • Own BREP construction tool supporting only BSplines and planes/lines, strictly conserver uniqueness of the entities. No support for boolean operations yet.
  • Wrapping functions for the GMSH library (which uses OCC in turn). Trying to eliminate some of the drawbacks by tracking entities created by OCC.

Features:

bgem.bspline

Longterm goal to have own CAD like library producing only compatible geometries (indepdent of OCC).

  • representation of B-spline curves and surfaces
  • approximation of point clouds by B-spline curves and surfaces
  • (in progress) intersections of curves and surfaces
  • composition of compatible 3D geometries using BREP format and B-splines
  • (in progress) ultimate goal: fast algorithms for B-spline logical operations

bgem.gmsh

Wrapping 'gmsh-sdk' meat and bones into enjoyable being.

  • documented interface to usefule GMSH options
  • documented and usable wrapper for 'Fields'
  • operations with groups of shapes
  • own association of shapes with regions, assigned just before meshing or even after meshing

bgem.polygons

Decomposition of the plane into disjoint polygons by line segments.

  • keep compatibility (i.e. single segment separting two polygons)
  • support for merging close points and segments with sharp angles (enhance regularity of resulting mesh)
  • support for assignment of regions (or other data) to the shapes (points, segments, polygons)
  • support for undo/redo of the operations

bgem.stochastic

Stochastic discrete fracture network.

  • stochastic description and realization of raw a fracture set
  • (in progress) calculating intersections
  • (in progress) regularization of the fracture network

Installation

Installation from PYPI

System-wide installation of a last version from PYPI. Need root/admin access (or sudo).

pip install bgem

Installation from PYPI into the user's directory, no admin access necessary. E.g. on a cluster. However prefered is usage of a virtual environment.

pip install --user bgem

Instalation from sources

Installation from sources located in DIR (copy of sources is performed).

pip install DIR

Installation from sources located in DIR. It uses links to the editable sources (usefull for debugging).

pip install -e DIR

Authors

Jan Březina, Jiří Kopal, Radek Srb, Jana Ehlerová, Jiří Hnídek

Dependencies

Theory references

Patrikalakis-Maekawa-Cho

Similar libraries (for B-splines)

  • NURBS++ - unmantained, last updates from 2002, seems there is no support for intersections
  • libnurbs - effort to add intersections and other features to the openNURBBS library provided by Rhino
  • SINTEF SISL - mature, mantained, features, C lib:
    • approximation for curves
    • intersection of curves
    • closest point problems for curves
    • evaluation and manipulation of curves
    • approximation of surfaces
    • intersection of surfaces: topology and inspection of the intersection curve
    • evaluation and manipulation of surfaces
  • Ayam - under development, 3d modeling tool .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bgem-0.3.0.tar.gz (156.1 kB view details)

Uploaded Source

Built Distribution

bgem-0.3.0-py3-none-any.whl (167.4 kB view details)

Uploaded Python 3

File details

Details for the file bgem-0.3.0.tar.gz.

File metadata

  • Download URL: bgem-0.3.0.tar.gz
  • Upload date:
  • Size: 156.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for bgem-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b799a8da8c91fde66d1e7a273ce75aad152e4be2a80d7c2bf724f1165f5d5517
MD5 5c464b3b0cb1b0c05f42cbc06bbe282c
BLAKE2b-256 8acc1d303296fad83fe549e681f8706a2d3d0eb254529a87495fa50a1535cdd1

See more details on using hashes here.

File details

Details for the file bgem-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: bgem-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 167.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for bgem-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef4febfda48020f90b2264c4e94dc2df318b8821cd73e054ceddff6cb10dd1a9
MD5 98dded134b7c0e3f10896e2e448bade1
BLAKE2b-256 5cc14b75daa00709cf1d882d37293b128374238ec0d76d1cda1fe5111a2c6744

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page