GeoMop / bapprox

Python tool for approximate 3d points using Bspline surface
3 stars 1 forks source link

Implement fractures #10

Open jirihnidek opened 8 years ago

jirihnidek commented 8 years ago
jirihnidek commented 8 years ago

Fractures can be loaded in BREP file format:

terrain_fractures

jirihnidek commented 8 years ago

Try to use this method section = BRepAlgoAPI_Section(surface, face): http://api.pythonocc.org/OCC.BRepAlgoAPI.html#OCC.BRepAlgoAPI.BRepAlgoAPI_Section for computing intersection between face and B-Spline surface.

Edit: no this method is not faster than boolean operations.

jirihnidek commented 7 years ago

It is possible to split volume into the two compatible volumes:

netgen_mesher-two_compatible-volumes

jirihnidek commented 7 years ago

It is possible to create volume defined by box, which is created from 7 faces:

netgen-7_faces_cube

It means that further splitting of volume is in theory possible.

jbrezmorf commented 7 years ago

Seems great. Try further splitting and b-spline faces. What about interior faces, i.e. face with some or whole boundary inside.

On Mon, Feb 13, 2017 at 12:29 PM, Jiri Hnidek notifications@github.com wrote:

It is possible to create volume defined by box, which is created from 7 faces:

[image: netgen-7_faces_cube] https://cloud.githubusercontent.com/assets/2057012/22881682/fc2faa30-f1e7-11e6-8cb6-7b787f0a2b3c.png

It means that further splitting of volume is in theory possible.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/GeoMop/bapprox/issues/10#issuecomment-279361469, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT6PO74uxXNXq_sD2w54KOqlGTZDOFBks5rcD6jgaJpZM4IQsQQ .

jirihnidek commented 7 years ago

I just work on further splitting. Results you already see is created by code using b-spline faces. It seems flat, but everything is defined by b-spline faces. First NetGen screenshot has interior face.

Face partially dived into volume or face with whole boundary inside volume is something more complicated and I don't know how to solve it ATM.

jbrezmorf commented 7 years ago

What about subtracting a degenerate flat volume given by oppositely oriented faces of a single surface? While the hierarchy of subdivisions may be used to specify different volumes with different properties the subtracting may be used to specify compatible fracture network. Backup solution is adding artificial fractures to convert it to the previous case (subdivision).

On Mon, Feb 13, 2017 at 2:40 PM, Jiri Hnidek notifications@github.com wrote:

I just work on further splitting. Results you already see is created by code using b-spline faces. It seems flat, but everything is defined by b-spline faces. First NetGen screenshot has interior face.

Face partially dived into volume or face with whole boundary inside volume is something more complicated and I don't know how to solve it ATM.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/GeoMop/bapprox/issues/10#issuecomment-279395158, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT6PKgIXQKvKNtN4N4wYgn39STFwa9Uks5rcF1UgaJpZM4IQsQQ .

jirihnidek commented 7 years ago

I can confirm that It is possible to create one compound containing two volumes with shared face. GMSH is not able to mesh volume, but NetGen Mesher creates compatible meshes for volumes and shells. Notice that volumes are visualized with different colors:

netgent_two_volumes

jirihnidek commented 7 years ago

It seems that splitting volume to more parts is complicated. The hard part is replacing one face with more faces:

https://www.opencascade.com/content/compound-made-2-solids-shared-face

At least it is described.

jirihnidek commented 7 years ago

Replacing face using BRepTools_ReShape() is just not good enough, when you try to "join" more then two shells/solids. Netgen cries, because there is duplicity in edges. It is interesting that netgen doesn't care, when there are two shells/solids.

jirihnidek commented 7 years ago

WIP: It is more complicated, than I thought. 4 new edges orthogonal to removed face have wrong direction. Good news is: I was able to manually edit generated BREP file and create correct BREP file (I replaced 4 - characters with 4 + characters). It was possible to mesh final BREP file in netgen:

netgen_11_faces

I hope I will have working algorithm fixing wrong direction of edges tomorrow.

I did also some experiments with Glue* functions. It can remove common face of two solids, but it produces only one solid. Thus it does almost the same thing as sewing and it is not useful for our purpose.

jirihnidek commented 7 years ago

This is mindblowing. The only one problem was missing switch of orientation of vertex. In what universe does have single point orientation? Crazy library!

jbrezmorf commented 7 years ago

Congratulation. It's a kind of magic.

On Mon, Mar 20, 2017 at 4:09 PM, Jiri Hnidek notifications@github.com wrote:

This is mindblowing. The only one problem was missing switch of orientation of vertex. In what universe does single point orientation? Crazy library!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/GeoMop/bapprox/issues/10#issuecomment-287789172, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT6PM1PBDI5XUYHyg3lq5uqOVbbpc__ks5rnpa8gaJpZM4IQsQQ .

jirihnidek commented 7 years ago

Screenshot with three solids:

netgen-3-solids

jirihnidek commented 7 years ago

I did some experiments with unusual shapes of cutting solids objects and results are OK. Meshing of final BREP files is OK too:

bapprox-triangle bapprox-odsek

jbrezmorf commented 7 years ago

Looks good. What about more cuttings, e.g. more levels of recursive cuttings?

On Wed, Mar 22, 2017 at 4:58 PM, Jiri Hnidek notifications@github.com wrote:

I did some experiments with unusual shapes of cutting solids objects and results are OK. Meshing of final BREP files is OK too:

[image: bapprox-triangle] https://cloud.githubusercontent.com/assets/2057012/24207204/a17afb70-0f20-11e7-9954-f137608d343c.png [image: bapprox-odsek] https://cloud.githubusercontent.com/assets/2057012/24207212/a584fc16-0f20-11e7-96ce-f89819767122.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/GeoMop/bapprox/issues/10#issuecomment-288446674, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT6PAjGNo6dqmxntegzfal9oEtwhdWSks5roUUhgaJpZM4IQsQQ .

jirihnidek commented 7 years ago

I will test more cutting today. Some more experiment from yesterday:

baprox-box

jirihnidek commented 7 years ago

Some non trivial examples with more levels of splitting. Due to second example I had to fix one bug.

bapprox_three_solids_01 bapprox_three_solids_02

Of course, I was able to do compatible meshing of all compounds.

jirihnidek commented 7 years ago

WIP: splitting of splitted solid works as well glue it together. What remains is glue following shapes with other two solids.

bapprox_four_wip

jirihnidek commented 7 years ago

Almost done. Screenshot from GMSH to show compatible meshing of solids:

gmsh_meshing_tri-wip

jirihnidek commented 7 years ago

My task in this project is finished: gmsh-four_solids-compatible_meshing