Skip to content

HaoxuanGuo/MeshBridge.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codecov

Why This Package

Because there are two packages about geometry

These two are not compatible now. This package is use to convert types between these two packages.

Thanks Felipe Kersting write the code and Manuel Schmid write the code from GeometryBasics.Mesh to Meshes.Mesh.

NOTE: YOU SHOULD NOT USE BOTH TWO PACKAGE IN YOUR CODE. BECAUSE THE CONVERSION IS VERY SLOW. IT IS JUST WORK WITH OUT ANY PERFORMANCE.

How to Use This Package

Via convert method.

using MeshIO
using FileIO
using Meshes
using GeometryBasics: GeometryBasics

old_mesh = load("bunny.stl")  # This file is not in package. Just for sample.
new_mesh = convert(Mesh, old_mesh)
convert_back_mesh = convert(GeometryBasics.Mesh, new_mesh)

old_triangle = old_mesh[1]
new_triangle = convert(Triangle, old_triangle)
convert_back_triangle = convert(GeometryBasics.Triangle, new_triangle)

old_point = old_triangle[1]
new_point = convert(Point, old_point)
convert_back_point = convert(GeometryBasics.Point, new_point)

note: using two packages at the same time will get conflict. Just import the one you use in your inner code.

using GeometryBasics
using Meshes  # Get conflict here.

The above will get conflict. Use the below code.

using GeometryBasics: GeometryBasics    # The one just for compatible
using Meshes                            # The one real used

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages