Code Monkey home page Code Monkey logo

Comments (6)

Fedr avatar Fedr commented on May 17, 2024 1

Hi,

We have a method in Mesh class for this:

/// split given triangle on three triangles, introducing new vertex (which is returned) in the centroid of original triangle and connecting it to its vertices;
/// if region is given, then it must include (f) and new faces will be added there as well
/// \param new2Old receive mapping from newly appeared triangle to its original triangle (part to full)
MRMESH_API VertId splitFace( FaceId f, FaceBitSet * region = nullptr, FaceHashMap * new2Old = nullptr );

It takes on input face Id and returns newly created vertex Id, so the usage example will be something like this:

Mesh mesh = ...
FaceId f = ...
VertId v = mesh.splitFace( f );
mesh.points[v] = coords;

This method is not exposed yet in python API. We will do it in the next release.

from meshlib.

Fedr avatar Fedr commented on May 17, 2024 1

I think we will make next release in about a week.

from meshlib.

MurrayC7 avatar MurrayC7 commented on May 17, 2024

Thanks for the prompt reply!
Looking forward to the release, before that, I will take a look at the logic.
BTW, when is this expected release? :)

from meshlib.

xiaodongdong101 avatar xiaodongdong101 commented on May 17, 2024

If I know there is a coordinate point on the surface of the model, I don't know which face it's on,how should I split it better?
code***********
MR::Mesh model;
MR::Vector3f point;
How should I split it better?

from meshlib.

Grantim avatar Grantim commented on May 17, 2024

Use

///
/**
* \brief computes the closest point on mesh (or its region) to given point
* \param upDistLimitSq upper limit on the distance in question, if the real distance is larger than the function exits returning upDistLimitSq and no valid point
* \param xf mesh-to-point transformation, if not specified then identity transformation is assumed
* \param loDistLimitSq low limit on the distance in question, if a point is found within this distance then it is immediately returned without searching for a closer one
* \param skipFace this triangle will be skipped and never returned as a projection
*/
[[nodiscard]] MRMESH_API MeshProjectionResult findProjection( const Vector3f & pt, const MeshPart & mp,
float upDistLimitSq = FLT_MAX,
const AffineXf3f * xf = nullptr,
float loDistLimitSq = 0,
FaceId skipFace = {} );

to find closest point on mesh

from meshlib.

xiaodongdong101 avatar xiaodongdong101 commented on May 17, 2024

Thanks a lot.

from meshlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.