All Projects → neilmendoza → ofxCorkCsg

neilmendoza / ofxCorkCsg

Licence: other
A constructive solid geometry (mesh boolean) addon for openFrameworks.

Programming Languages

c
50402 projects - #5 most used programming language
C++
36643 projects - #6 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to ofxCorkCsg

unity-plumber
A component to procedurally generate pipe-like meshes in Unity
Stars: ✭ 55 (+27.91%)
Mutual labels:  mesh, mesh-generation
roadifier
Open Source road mesh generator script for Unity
Stars: ✭ 30 (-30.23%)
Mutual labels:  mesh, mesh-generation
Mosaic
Mosaic, an openFrameworks based Visual Patching Creative-Coding Platform
Stars: ✭ 250 (+481.4%)
Mutual labels:  creative-coding, openframeworks
Openframeworks
openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
Stars: ✭ 8,652 (+20020.93%)
Mutual labels:  creative-coding, openframeworks
DM-GY-9103-Advanced-Creative-Coding
Class repository for Advanced Creative Coding
Stars: ✭ 28 (-34.88%)
Mutual labels:  creative-coding, openframeworks
Example Mediapipe Udp
Connecting openFrameworks to Google MediaPipe Machine Learning Framework over UDP
Stars: ✭ 217 (+404.65%)
Mutual labels:  creative-coding, openframeworks
ofxOpenCvDnnObjectDetection
OpenCV based DNN Object Detection Library for Openframeworks
Stars: ✭ 34 (-20.93%)
Mutual labels:  openframeworks, openframeworks-addon
3d Machine Learning
A resource repository for 3D machine learning
Stars: ✭ 7,405 (+17120.93%)
Mutual labels:  mesh, constructive-solid-geometries
recoded
Re-coded by the School for Poetic Computation—crowdsourced recreations of early digital works using new tools
Stars: ✭ 57 (+32.56%)
Mutual labels:  creative-coding, openframeworks
ofxPubSubOsc
bind OSC messages and values with only writing tiny codes on setup once.
Stars: ✭ 72 (+67.44%)
Mutual labels:  openframeworks, openframeworks-addon
Ofxstatusbar
Addon for openFrameworks to add icons and text to the statusbar of Mac OS X (needs support - see readme)
Stars: ✭ 11 (-74.42%)
Mutual labels:  creative-coding, openframeworks
ofxDeferredShading
an openFrameworks addon for shading, lighting, lens simulation.
Stars: ✭ 78 (+81.4%)
Mutual labels:  openframeworks, openframeworks-addon
Ofelia
A real-time cross-platform creative coding tool for multimedia development
Stars: ✭ 269 (+525.58%)
Mutual labels:  creative-coding, openframeworks
ofxOilPaint
An oil painting simulation addon for openFrameworks
Stars: ✭ 45 (+4.65%)
Mutual labels:  openframeworks, openframeworks-addon
Meshlab
The open source mesh processing system
Stars: ✭ 2,619 (+5990.7%)
Mutual labels:  mesh, mesh-generation
ofxTouchPad
Multitouch support for touchpads.
Stars: ✭ 23 (-46.51%)
Mutual labels:  openframeworks, openframeworks-addon
Point2Mesh
Meshing Point Clouds with Predicted Intrinsic-Extrinsic Ratio Guidance (ECCV2020)
Stars: ✭ 61 (+41.86%)
Mutual labels:  mesh, mesh-generation
SkeletonBridgeRecon
The code for CVPR2019 Oral paper "A Skeleton-bridged Deep Learning Approach for Generating Meshes of Complex Topologies from Single RGB Images"
Stars: ✭ 72 (+67.44%)
Mutual labels:  mesh, mesh-generation
ofxCameraAnaglyph
Anaglyph Camera for Stereo 3D Rendering for OpenFrameworks
Stars: ✭ 25 (-41.86%)
Mutual labels:  openframeworks, openframeworks-addon
PdWebParty
An app that allows Pd users to run patches in a web browser and share them with a web link
Stars: ✭ 37 (-13.95%)
Mutual labels:  creative-coding

ofxCorkCsg by Neil Mendoza

ofxCorkCsg

Constructive solid geometry (mesh boolean) addon for openFrameworks v0.10+ based on this fork of the Cork library.

Usage

The addon includes mesh generation functions that create meshes that will work "out of the box" with the boolean operations:

  • void cylinder(ofMesh& mesh, float height, float radius)
  • void sphere(ofMesh& mesh, float radius)
  • void box(ofMesh& mesh, float width, float height, float depth)
  • void octohedron(ofMesh& mesh, float width, float height)

To use the library, generate a mesh and then execute one of the operations.

// input meshes
ofMesh boxMesh, sphereMesh;

// create box
ofxCorkCsg::box(boxMesh, 150.f, 150.f, 150.f);

// create sphere
ofxCorkCsg::sphere(sphereMesh, 100.f);

// output mesh
ofMesh outMesh;

// result = A U B
ofxCorkCsg::computeUnion(boxMesh, sphereMesh, outMesh);

// result = A - B
// ofxCorkCsg::computeDifference(boxMesh, sphereMesh, outMesh);

// result = A ^ B
// ofxCorkCsg::computeIntersection(boxMesh, sphereMesh, outMesh);

// result = A XOR B
// ofxCorkCsg::computeSymmetricDifference(boxMesh, sphereMesh, outMesh);

Cork Mesh Format

The boolean functions that take ofMesh objects as input convert them to Cork's mesh format, CorkTriMesh. This conversion copies the vertices and indices. If you are going to be doing repeated operations on meshes that do not change then it would be more efficient to convert them to ofxCorkCsg::MeshWrapper objects and call the boolean functions on those.

ofMesh in0Mesh, in1Mesh, outMesh;

// generate or load in0 and in1 here

ofxCorkCsg::MeshWrapper in0Wrapper(in0Mesh);
ofxCorkCsg::MeshWrapper in1Wrapper(in1Mesh);
ofxCorkCsg::computeUnion(in0Wrapper, in1Wrapper, outMesh);

The wrapper contains an instance of Cork's native CorkTriMesh that is publicly accessible as wrapper.corkTriMesh.

Mesh Requirements

If you decide to use a mesh that is not generated by the addon then it needs to satisfy the following requirements:

  • Wateright
  • Counter-clockwise triangle winding
  • Shared vertices
  • Primitive mode OF_PRIMITIVE_TRIANGLES

The ofxCorkCsg::unifyVertices(const ofMesh& inMesh, ofMesh& outMesh) function will share a mesh's vertices for you.

ofMesh nonSharedMesh;

// generate or load nonSharedMesh here

ofMesh sharedMesh;

ofxCorkCsg::unifyVertices(nonSharedMesh, sharedMesh);

If you are unsure whether a mesh you are working with satisfies Cork's requirements, the Cork API has an isSolid(CorkTriMesh mesh) function that will check the mesh and log any problems.

ofMesh isThisOk;

// generate or load mesh here

ofxCorkCsg::MeshWrapper wrapper(isThisOk);

isSolid(wrapper.corkTriMesh);

Compatibility

The addon is compatible with openFrameworks v0.10, at the time of writing, this is the master branch on github rather than the stable download from the website.

Cork is dependent on the GMP library and at the moment only the OSX version is included here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].