stla / polygonsoup Goto Github PK
View Code? Open in Web Editor NEWMake a consistent mesh from a polygon soup.
Make a consistent mesh from a polygon soup.
/opt/local/bin/g++-mp-12 -std=gnu++17 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/opt/local/Library/Frameworks/R.framework/Resources/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -L/opt/local/lib -lMacportsLegacySupport -arch ppc -o PolygonSoup.so RcppExports.o ReadWrite.o mesh.o unexported1.o unexported2.o -L/opt/local/lib -lgmp -lmpfr -lgmp -F/opt/local/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /opt/local/var/macports/build/_opt_PPCRosettaPorts_R_R-PolygonSoup/R-PolygonSoup/work/destroot/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/00LOCK-PolygonSoup/00new/PolygonSoup/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘PolygonSoup’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/opt/local/var/macports/build/_opt_PPCRosettaPorts_R_R-PolygonSoup/R-PolygonSoup/work/destroot/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/00LOCK-PolygonSoup/00new/PolygonSoup/libs/PolygonSoup.so':
dlopen(/opt/local/var/macports/build/_opt_PPCRosettaPorts_R_R-PolygonSoup/R-PolygonSoup/work/destroot/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/00LOCK-PolygonSoup/00new/PolygonSoup/libs/PolygonSoup.so, 6): Symbol not found: ___atomic_load_8
Referenced from: /opt/local/var/macports/build/_opt_PPCRosettaPorts_R_R-PolygonSoup/R-PolygonSoup/work/destroot/opt/local/Library/Frameworks/R.framework/Versions/4.2/Resources/library/00LOCK-PolygonSoup/00new/PolygonSoup/libs/PolygonSoup.so
Expected in: dynamic lookup
Error: loading failed
Execution halted
ERROR: loading failed
Dear developers,
when using the function writeMeshFile() to write a .obj file (Wavefront file), the vertex indexing start from zero, while it should start from 1 (https://en.wikipedia.org/wiki/Wavefront_.obj_file).
This wrong indexing prevent the file to be imported correctly in 3D visualization/modeling tools such as Blender.
example code:
rm(list=ls())
library(PolygonSoup)
my.mesh <- list()
my.mesh$vertices <-rbind(c(1,1,0),c(1,-1,0),c(-1,-1,0),c(-1,1,0))
my.mesh$faces <- matrix(c(1,2,3,4), ncol=4)
writeMeshFile(mesh = my.mesh, filename = 'my_mesh.obj')
resulting in output file (my_mesh.obj):
# file written from a CGAL tool in Wavefront obj format
# 4 vertices
# 0 halfedges
# 1 facets
# 4 vertices
# ------------------------------------------
v 1 1 0
v 1 -1 0
v -1 -1 0
v -1 1 0
# 1 facets
# ------------------------------------------
f 0 1 2 3
# End of Wavefront obj format #
that cannot be used, since facets are defined with vertex index starting from zero (f 0 1 2 3
while it should be f 1 2 3 4
).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.