Skip to content

Commit 9296d48

Browse files
committed
fisrt example
1 parent e584ce4 commit 9296d48

File tree

4 files changed

+217
-0
lines changed

4 files changed

+217
-0
lines changed

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<h1 align="center">Geode-SimplexRemesh<sup><i>by Geode-solutions</i></sup></h1>
2+
<h3 align="center">Simplex remeshing for Geode-solutions OpenGeode modules</h3>
3+
4+
<!-- <p align="center">
5+
<img src="https://github.com/Geode-solutions/OpenGeode-Geosciences/workflows/CI/badge.svg" alt="Build Status">
6+
<img src="https://github.com/Geode-solutions/OpenGeode-Geosciences/workflows/CD/badge.svg" alt="Deploy Status">
7+
<img src="https://codecov.io/gh/Geode-solutions/OpenGeode-Geosciences/branch/master/graph/badge.svg" alt="Coverage Status">
8+
<img src="https://img.shields.io/github/release/Geode-solutions/OpenGeode-Geosciences.svg" alt="Version">
9+
<img src="https://img.shields.io/pypi/v/opengeode-geosciences" alt="PyPI" >
10+
</p> -->
11+
12+
<p align="center">
13+
<img src="https://img.shields.io/static/v1?label=Windows&logo=windows&logoColor=white&message=support&color=success" alt="Windows support">
14+
<img src="https://img.shields.io/static/v1?label=Ubuntu&logo=Ubuntu&logoColor=white&message=support&color=success" alt="Ubuntu support">
15+
<img src="https://img.shields.io/static/v1?label=Red%20Hat&logo=Red-Hat&logoColor=white&message=support&color=success" alt="Red Hat support">
16+
</p>
17+
18+
<p align="center">
19+
<!-- <img src="https://img.shields.io/badge/C%2B%2B-11-blue.svg" alt="Language">
20+
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License">
21+
<img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg" alt="Semantic-release"> -->
22+
<a href="https://slackin-opengeode.herokuapp.com">
23+
<img src="https://slackin-opengeode.herokuapp.com/badge.svg" alt="Slack invite">
24+
</a>
25+
<a href="https://doi.org/10.5281/zenodo.3610370">
26+
<img src="https://zenodo.org/badge/DOI/10.5281/zenodo.3610370.svg" alt="DOI">
27+
</a>
28+
</p>
29+
30+
---
31+
32+
## Introduction
33+
34+
Geode-SimplexRemesh is an [OpenGeode](https://github.com/Geode-solutions/OpenGeode) module providing simplicial surfacic remeshing and volume algorithms of boundary representation.
35+
This is a proprietary module from [Geode-solutions](https://geode-solutions.com), you will need a license file to use it.
36+
Please contact us directly for more information by [slack](https://slackin-opengeode.herokuapp.com) or by [mail](mailto:contact@geode-solutions.com).
37+
38+
## Documentation
39+
40+
This repository provides Jupyter notebooks used as example usage of the module.
41+
For more general documentation on OpenGeode, check out our live documentation, visit [docs.geode-solutions.com](https://docs.geode-solutions.com).
42+
43+
Installing Geode-Conversion is done by using pip command ```pip install Geode-SimplexRemesh``` and add ```import geode_simplexremesh``` in your Python script.
44+
45+
## Questions
46+
47+
For questions and support please use the official [slack](https://slackin-opengeode.herokuapp.com) and go to the channel #help. The issue list of this repo is exclusively for bug reports and feature requests.
48+
49+
Copyright (c) 2019 - 2020, Geode-solutions

brep_remeshing.ipynb

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"metadata": {
3+
"language_info": {
4+
"codemirror_mode": {
5+
"name": "ipython",
6+
"version": 3
7+
},
8+
"file_extension": ".py",
9+
"mimetype": "text/x-python",
10+
"name": "python",
11+
"nbconvert_exporter": "python",
12+
"pygments_lexer": "ipython3",
13+
"version": "3.8.5-final"
14+
},
15+
"orig_nbformat": 2,
16+
"kernelspec": {
17+
"name": "python38564bit803274702961490c8f23f97c39496878",
18+
"display_name": "Python 3.8.5 64-bit"
19+
}
20+
},
21+
"nbformat": 4,
22+
"nbformat_minor": 2,
23+
"cells": [
24+
{
25+
"source": [
26+
"# Simplicial surface remeshing of boundary representation\n",
27+
"\n",
28+
"The goal is to remesh a surfacic boundary representation as defined here: https://docs.geode-solutions.com/datamodel.\n",
29+
"The `Lines` and `Surfaces` will be remeshed according the input mesh sizes while keeping the topology (meaning the relationships between the model components) and the conformity (meaning the mesh element boundaries are geometrically identical) of the model.\n"
30+
],
31+
"cell_type": "markdown",
32+
"metadata": {}
33+
},
34+
{
35+
"source": [
36+
"## Import modules\n",
37+
"\n",
38+
"You need to import OpenGeode and Geode-SimplexRemesh modules."
39+
],
40+
"cell_type": "markdown",
41+
"metadata": {}
42+
},
43+
{
44+
"cell_type": "code",
45+
"execution_count": null,
46+
"metadata": {},
47+
"outputs": [],
48+
"source": [
49+
"# Fix to better handle import since Python 3.8 on Windows\n",
50+
"import os, sys, platform\n",
51+
"if sys.version_info >= (3,8,0) and platform.system() == \"Windows\":\n",
52+
" for path in [x.strip() for x in os.environ['PATH'].split(';') if x]:\n",
53+
" os.add_dll_directory(path)\n",
54+
"\n",
55+
"import opengeode\n",
56+
"from geode_simplexremesh import surface # only the \"surface\" part of the package is needed"
57+
]
58+
},
59+
{
60+
"source": [
61+
"## Remeshing at constant mesh size\n",
62+
"\n",
63+
"In this section, we will see how to remesh a model using a constant mesh size."
64+
],
65+
"cell_type": "markdown",
66+
"metadata": {}
67+
},
68+
{
69+
"cell_type": "code",
70+
"execution_count": null,
71+
"metadata": {},
72+
"outputs": [],
73+
"source": [
74+
"# Load a model and remesh it\n",
75+
"brep = opengeode.load_brep(\"brep_to_remesh.og_brep\")\n",
76+
"mesh_size = 42\n",
77+
"remeshed_brep, mappings = surface.homogeneous_brep_remeshing(brep, mesh_size) \n",
78+
"# the second return value \"mappings\" is for advanced usage and can be discarded\n",
79+
"opengeode.save_brep(remeshed_brep, \"remeshed_brep.og_brep\")"
80+
]
81+
}
82+
]
83+
}

brep_tetrahedralizing.ipynb

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"metadata": {
3+
"language_info": {
4+
"codemirror_mode": {
5+
"name": "ipython",
6+
"version": 3
7+
},
8+
"file_extension": ".py",
9+
"mimetype": "text/x-python",
10+
"name": "python",
11+
"nbconvert_exporter": "python",
12+
"pygments_lexer": "ipython3",
13+
"version": "3.8.5-final"
14+
},
15+
"orig_nbformat": 2,
16+
"kernelspec": {
17+
"name": "python38564bit803274702961490c8f23f97c39496878",
18+
"display_name": "Python 3.8.5 64-bit"
19+
}
20+
},
21+
"nbformat": 4,
22+
"nbformat_minor": 2,
23+
"cells": [
24+
{
25+
"source": [
26+
"# Simplicial volume meshing of boundary representation\n",
27+
"\n",
28+
"The goal is to mesh a boundary representation as defined here: https://docs.geode-solutions.com/datamodel.\n",
29+
"The `Blocks` will be meshed according the input mesh sizes while keeping the topology (meaning the relationships between the model components) and the conformity (meaning the mesh element boundaries are geometrically identical) of the model. So the mesh of the `Surfaces` will be embedded into the tetrahedral solid mesh boundaries. \n"
30+
],
31+
"cell_type": "markdown",
32+
"metadata": {}
33+
},
34+
{
35+
"source": [
36+
"## Import modules\n",
37+
"\n",
38+
"You need to import OpenGeode and Geode-SimplexRemesh modules."
39+
],
40+
"cell_type": "markdown",
41+
"metadata": {}
42+
},
43+
{
44+
"cell_type": "code",
45+
"execution_count": null,
46+
"metadata": {},
47+
"outputs": [],
48+
"source": [
49+
"# Fix to better handle import since Python 3.8 on Windows\n",
50+
"import os, sys, platform\n",
51+
"if sys.version_info >= (3,8,0) and platform.system() == \"Windows\":\n",
52+
" for path in [x.strip() for x in os.environ['PATH'].split(';') if x]:\n",
53+
" os.add_dll_directory(path)\n",
54+
"\n",
55+
"import opengeode\n",
56+
"from geode_simplexremesh import solid # only the \"solid\" part of the package is needed"
57+
]
58+
},
59+
{
60+
"source": [
61+
"## Meshing without mesh size input\n",
62+
"\n",
63+
"In this section, we will see how to tetrahedralize a model. The surface meshes will not be affected by this operation."
64+
],
65+
"cell_type": "markdown",
66+
"metadata": {}
67+
},
68+
{
69+
"cell_type": "code",
70+
"execution_count": null,
71+
"metadata": {},
72+
"outputs": [],
73+
"source": [
74+
"# Load a model and remesh it\n",
75+
"brep = opengeode.load_brep(\"brep.og_brep\")\n",
76+
"solid.tetrahedralize(brep) # the given brep will be filled with tetradra\n",
77+
"opengeode.save_brep(brep, \"meshed_brep.og_brep\")"
78+
]
79+
}
80+
]
81+
}

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
OpenGeode-core >= 7.0.0, == 7.*
2+
Geode-Common >= 12.2.0, == 12.*
3+
Geode-Parameterization >= 1.3.2, == 1.*
4+
Geode-SimplexRemesh >= 3.2.0, == 3.*

0 commit comments

Comments
 (0)