Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9225835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:40:42+00:00 2026-06-18T04:40:42+00:00

I have cloud of 3d points (relief) and I need a simple algorithm of

  • 0

I have cloud of 3d points (relief) and I need a simple algorithm of creating nonconvex 3d model. Could you help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:40:44+00:00Added an answer on June 18, 2026 at 4:40 am

    A quick and rather easy to implement algorithm for getting a decent hull of triangles around the points (outside and inside!) is based on the “Marching Cubes” algorithm:

    • define a grid (minimal x,y,z values + grid resolutions in x,y,z direction + number of points in x,y,z direction)
    • initialize a value for each grid point to zero
    • “rasterize” the given points (round the coordinates to the nearest grid point); for the trivial version just set the corresponding grid point’s value to 1
    • Now you can polygonize each basic cube of the grid with the “Marching Cubes” algorithm with an isolevel of 0.9.

    These code snippets might help you. For initializing:

    union XYZ {
        struct {
            double x,y,z;
        };
        double coord[3];
    };
    typedef std::vector<XYZ> TPoints;
    TPoints points;
    // get points from file or another data structure
    
    // initialize these values for your needs (the bounding box of the points will help)    
    XYZ coordsMin, coordsMax;
    XYZ voxelSize; // grid resolution in each coordinate direction
    int gridSize; // number of grid points, here the same for each coordinate direction
    
    int gridSize2 = gridSize*gridSize;
    char* gridVals = new char[gridSize2*gridSize];
    for (int i=0; i<gridSize; ++i)
    for (int j=0; j<gridSize; ++j)
    for (int k=0; k<gridSize; ++k)
        gridVals[i*gridSize2+j*gridSize+k] = 0;
    
    for (size_t i=0; i<points,size(); ++i)
    {
        XYZ const& p = points[i];
        int gridCoords[3];
        for (int c=0; c<3; ++c)
            gridCoords[c] = (int)((p.coord[c]-coordsMin.coord[c])/voxelSize.coord[c]);
        int gridIdx = gridCoords[0]*gridSize2 + gridCoords[1]*gridSize + gridCoords[2];
        gridVals[gridIdx] = 1;
    }
    

    And then for computing the triangles based on the function Polygonize from the cited implementation:

    const double isolevel = 0.9;
    
    TRIANGLE triangles[5]; // maximally 5 triangles for each voxel
    int cellCnt = 0;
    for (int i=0; exportOk && i<gridSize-1; ++i)
    for (int j=0; exportOk && j<gridSize-1; ++j)
    for (int k=0; exportOk && k<gridSize-1; ++k)
    {
        GRIDCELL cell;
        for (int cornerIdx=0; cornerIdx<8; ++cornerIdx)
        {
            XYZ& corner = cell.p[cornerIdx];
            // the function Polygonize expects this strange order of corner indexing ...
            // (see http://paulbourke.net/geometry/polygonise/)
            int xoff = ((cornerIdx+1)/2)%2;
            int yoff = (cornerIdx/2)%2;
            int zoff = cornerIdx/4;
            corner.x = (i+xoff)*voxelSize.x + coordsMin.x;
            corner.y = (j+yoff)*voxelSize.y + coordsMin.y;
            corner.z = (k+zoff)*voxelSize.z + coordsMin.z;
            cell.val[cornerIdx] = gridVals[(i+xoff)*gridSize2+(j+yoff)*gridSize+k+zoff];
        }
        int triangCnt = Polygonise(cell, isolevel, triangles);
        triangCntTotal += triangCnt;
        triangCntTotal += triangCnt;
        for (int t=0; t<triangCnt; ++t)
        {
            TTriangle const& triangle = triangles[t].p;
            ExportTriangle(triangle);
        }
    }
    

    This did the trick for me in an industrial application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a cloud of Points and I need the best fitting Line. I'm
I have a cloud model and it continues to go behind the background scene
I have an object made of points, lets say its point cloud, i want
If I have a set of 3d points (AKA point cloud) what is the
I have a very large point cloud (> 100000 points) that I'd like to
I have data points in x,y,z format. They form a point cloud of a
We have a Point3D[] - a points cloud. We want to find its center.
I have a cloud of points that are supposed to represent a face. I
Setting I have a PCL point cloud of type PointXYZ . I need to
I have a GUI application which works with point cloud data and a quadtree

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.