Comments (10)
Good to know it works fine!
I agree about output arguments, I was also wondering about what was the best choice.
It may also depend on usage; I usually focus on closed meshes, so closed polygons as first output better fits me!
Another option is to gather all curves (open and closed) in a single cell array, and additionnally provide a logical array the same size as the curve array indicating whether the curve is closed or open. This will be also consistent with previous syntax.
Something like this:
[allCurves, closedFlag] = intersectPlaneMesh(plane, vertices, faces);
drawPolygon3d(allCurves(closedFlag), 'r');
drawPolyline3d(allCurves(~closedFlag), 'b');
Best,
from matgeom.
Something like this:
[allCurves, closedFlag] = intersectPlaneMesh(plane, vertices, faces); drawPolygon3d(allCurves(closedFlag), 'r'); drawPolyline3d(allCurves(~closedFlag), 'b');
Sounds good!
from matgeom.
Works great. Thank you.
I've also added the function clipMeshByPlane.m
from matgeom.
Hi,
yes, I think it is possible (I mean the algorithm can be extended to manage the case of open meshes. I'll investigate this.
from matgeom.
Hi David,
Thanks for all of your work on the Geom3D toolbox. I was wondering if there has been any updates for allowing intersecting a plane with an open mesh? This feature would greatly help my analysis
Thank you!
Zach
from matgeom.
Hi,
unfortunately not... The problem is the iteration over edge/vertices of the intersection. I do not know for the moment how to start iteration from extremities.
Still on the TODO list...
from matgeom.
Thank you for the update. I'll keep tinkering with it too and look forward to future updates if you figure it out.
PS for the requested functions list: I'm looking to intersect an open mesh with plane to then mirror the mesh across that plane and add in vertices & faces at the mirror plane
Thanks again!
from matgeom.
well, better later than never, I finally implemented management of mesh-plane intersection for open meshes (commit d2c03de)! The new syntax is as follow:
[closedCurves, openCurves] = intersectPlaneMesh(Plane, vertices, faces);
It returns closed polygons in first output argument (as before), and open polylines in second output argument. That way the function does not break existing code.
Hope you will find it useful...
from matgeom.
Great, thank you! I used it for a few test cases and it works fine.
However, I'm not quite sure if the output arguments are optimal. Often one will need something like:
if isempty(closedCurves)
curve = openCurves;
else
curve = closedCurves;
end
One could use a 'legacy' flag. I think that the way how they do it in MATLAB's build-in functions.
See https://www.mathworks.com/help/matlab/ref/double.unique.html for example.
Kind regards
from matgeom.
Just comitted the modification: b897628
from matgeom.
Related Issues (20)
- Orientations (yaw, pitch and roll) are very different for similar 3D points HOT 16
- Documentation on how to cite the work HOT 6
- [Question/ Enhancement] Possibility to dilate a geometry? HOT 2
- Octave install warning about verLessThan.m HOT 4
- getting started on octave HOT 4
- Standardization of the header HOT 20
- Move graphs\grSimplifyBranches_old.m to deprecated\graphs ? HOT 1
- Bugs in intersectEdges.m HOT 2
- Delete changelog.txt(s) ? HOT 4
- Move data files to subfolder or data folder? HOT 1
- clipPolygon3dHP is not fully implemented HOT 6
- medialAxisConvex is not fully implemented
- Plotting a vector of circles only plots the final circle in the vector HOT 4
- Rename clipPolygonHP to clipPolygonByLine? HOT 1
- Missing functions in Contents.m HOT 1
- Missing polygons2d.m HOT 4
- Rename clipMeshVertices to cutMeshVertices?
- vertexNormal duplicate of meshVertexNormals? HOT 1
- Rename polyhedronSlice to intersectPlaneConvexPolyhedron?
- Matgeom - verLessThan: package "matlab" is not installed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matgeom.