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

  • SEARCH
  • Home
  • 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 7840809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:55:31+00:00 2026-06-02T15:55:31+00:00

I am trying to add a color variable (unsigned char) to CGAL’s Point_3 class

  • 0

I am trying to add a color variable (unsigned char) to CGAL’s Point_3 class so I can access the color after doing Delaunay triangulation.

What I have tried is using Triangulation_vertex_base_with_info_3 to store the color like this (following the example at http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Triangulation_3/Chapter_main.html#Subsection_39.5.3)

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_vertex_base_with_info_3<unsigned char, K> Vb;
typedef CGAL::Triangulation_data_structure_3<Vb> Tds;
typedef CGAL::Delaunay_triangulation_3<K, Tds> Triangulation;
typedef Triangulation::Point CGAL_Point;

//...
//here I make a vector of pairs of points and their color

std::vector<std::pair<CGAL_Point, unsigned char> > points;

Point currentPoint;
for (int i=0; i<roiPoints.size(); i++){
    currentPoint=roiPoints[i];
    points.push_back(std::make_pair(CGAL_Point(currentPoint.x, currentPoint.y, currentPoint.z), roiColors[i]));
} 

//...
//triangulation
T.clear();
T.insert(points.begin(), points.end());

What I actually want to achieve is to be able to access vertices colors through the Triangulation::Tetrahedron class after doing the triangulation.

Let say I have a point P at (x,y,z). After triangulation I find the Tetrahedron t which contains this point P and I have access to this tetrahedron’s vertices (using t.vertex(0..3)). This returns vertices of type Point_3 and I can’t access the colors I have stored before.

I guess a way to do this is to create my own Point class which contains the color information. That’s easy, but I don’t understand how to use this class instead of Point_3. I found that I also have to write my own Kernel to do this and an example at http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Kernel_23/Chapter_main.html#Section_11.5 but I can’t figure out what Kernel should I use as base class or what functions should my Kernel even contain.

I even found two similar topics here at stackoverflow:
Customizing CGAL Kernel with my own Point class
and
CGAL: Inheritance and the kernel
but they didn’t help me.

Thank you for your help!

  • 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-02T15:55:34+00:00Added an answer on June 2, 2026 at 3:55 pm

    From your description, I think you simply need to add the color inside the vertex class.
    After the locate, you’ll have the simplex and will be able to access the color inside the vertices.

    See the examples here.

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

Sidebar

Related Questions

I am trying to add a highlight color to a class like this $(".common_box").hover(function(){
I am trying hard to figure out to add color gridient label to my
Trying to add an onclick handler to my tabs, and can't seem to get
I am trying to add color in c# code, with the following color code
Trying to add a color picker to a field in Dynamics AX 2009. Found
im trying to add a css class in my javascript code but when i
I'm trying to add a background color for an TextView on my ListView using
I simply am trying to add a color to the select item background within
I'm trying to write a function to add color to a table based on
In a Web Part for Sharepoint, I'm trying to add a variable number/ordering of

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.