Используя этот код: Unit1.h - //---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.Grids.hpp>
#include
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TPaintBox PaintBox1;
void __fastcall PaintBox1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent Owner);
};
struct TPoint_2D
{
double x, y;
int number;
};
struct TPoint2D
{
TPoint_2D Vertex;
};
std::vector Points;
class CalculationNormal
{
public:
double dx, dy, length, direction;
void Calculation (double x1, double x2, double y1, double y2, double &normal_x, double &normal_y);
};
std::vectorstd::vector Layers;
//---------------------------------------------------------------------------
extern PACKAGE TForm1 Form1;
//---------------------------------------------------------------------------
#endif В Unit1.cpp - //---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <math.h>
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource ".dfm"
TForm1 *Form1;

void CalculationNormal::Calculation(double x1, double x2, double y1, double y2, double &normal_x, double &normal_y)
{
dx = x2 - x1;
dy = y2 - y1;
length = sqrt(dx * dx + dy * dy);
normal_x = -dy / length;
normal_y = dx / length;
direction = (x1 + x2) / 2 * normal_x + (y1 + y2) / 2 * normal_y;
if (direction < 0)
{
normal_x = -normal_x;
normal_y = -normal_y;
}
}
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::PaintBox1Click(TObject *Sender)
{
Canvas->Pen->Color = clBlack;
Canvas->Pen->Width = 2;
double centerX = PaintBox1->Width / 2;
double centerY = PaintBox1->Height / 2;
int scale = 8;
double r1 = 10;
double r2 = 50;
double total_area = M_PI * (r2 * r2 - r1 * r1);
double filled_area = 0;
double length = 6.28; // длина стороны треугольника

Points.clear();
Layers.clear();


int number_layers = ceil((r2 - r1) / length) + 1;
double h = (r2 - r1) / (number_layers - 1);

for (int i = 0; i < number_layers; i++)
{
double radius_layer = r1 + i * h;
int number_points = ceil(2 * M_PI * radius_layer / length);
double alpha = 2 * M_PI / number_points;
std::vector Points_layer;
for (int j = 0; j < number_points; j++)
{
TPoint2D Point;
Point.Vertex.number = Points.size();
Point.Vertex.x = radius_layer * cos(j * alpha);
Point.Vertex.y = radius_layer * sin(j * alpha);
Points.push_back(Point);
Points_layer.push_back(Point);
}
Layers.push_back(Points_layer);
}


for (int i = 0; i < number_layers - 1; i++)
{
   auto& Layer1 = Layers[i];
   auto& Layer2 = Layers[i + 1];
        int number_points_1 = Layer1.size();
   int number_points_2 = Layer2.size();

   for (int j = 0; j < number_points_1; j++)
   {
                int next_j = (j + 1) % number_points_1;

                double min_distance = sqrt(pow(Layer2[0].Vertex.x - Layer1[j].Vertex.x, 2) +
                          pow(Layer2[0].Vertex.y - Layer1[j].Vertex.y, 2));
                int nearest_k = 0;
                for (int k = 1; k < number_points_2; k++)
                {
                        double distance = sqrt(pow(Layer2[k].Vertex.x - Layer1[j].Vertex.x, 2) +
                          pow(Layer2[k].Vertex.y - Layer1[j].Vertex.y, 2));
                        if (distance < min_distance)
                        {
                                min_distance = distance;
                                nearest_k = k;
                        }
                }

                Canvas->MoveTo(centerX + scale * Layer1[j].Vertex.x, centerY + scale * Layer1[j].Vertex.y);
                Canvas->LineTo(centerX + scale * Layer2[nearest_k].Vertex.x, centerY + scale * Layer2[nearest_k].Vertex.y);
                Canvas->LineTo(centerX + scale * Layer1[next_j].Vertex.x, centerY + scale * Layer1[next_j].Vertex.y);
                Canvas->LineTo(centerX + scale * Layer1[j].Vertex.x, centerY + scale * Layer1[j].Vertex.y);

                int next_k = (nearest_k + 1) % number_points_2;
                if (j == number_points_1 - 1)
                {
                        Canvas->MoveTo(centerX + scale * Layer2[nearest_k].Vertex.x, centerY + scale * Layer2[nearest_k].Vertex.y);
                        Canvas->LineTo(centerX + scale * Layer2[next_k].Vertex.x, centerY + scale * Layer2[next_k].Vertex.y);
                        Canvas->LineTo(centerX + scale * Layer1[0].Vertex.x, centerY + scale * Layer1[0].Vertex.y);
                        Canvas->LineTo(centerX + scale * Layer2[nearest_k].Vertex.x, centerY + scale * Layer2[nearest_k].Vertex.y);
                }
                else
                {
                        Canvas->MoveTo(centerX + scale * Layer2[nearest_k].Vertex.x, centerY + scale * Layer2[nearest_k].Vertex.y);
                        Canvas->LineTo(centerX + scale * Layer2[next_k].Vertex.x, centerY + scale * Layer2[next_k].Vertex.y);
                        Canvas->LineTo(centerX + scale * Layer1[next_j].Vertex.x, centerY + scale * Layer1[next_j].Vertex.y);
                        Canvas->LineTo(centerX + scale * Layer2[nearest_k].Vertex.x, centerY + scale * Layer2[nearest_k].Vertex.y);
                }
        }

        if (i == number_layers - 2)
        {
                for (int j = 0; j < number_points_2; j++)
                {
                        int next_j = (j + 1) % number_points_2;
                        Canvas->MoveTo(centerX + scale * Layer2[j].Vertex.x, centerY + scale * Layer2[j].Vertex.y);
                        Canvas->LineTo(centerX + scale * Layer2[next_j].Vertex.x, centerY + scale * Layer2[next_j].Vertex.y);
                        Canvas->MoveTo(centerX + scale * Layer2[j].Vertex.x, centerY + scale * Layer2[j].Vertex.y);
                }
        }
}
} переделай мой код: Unit1.h - //---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Graphics.hpp>
#include <ExtCtrls.hpp>
#include <System.SysUtils.hpp>
#include <System.Classes.hpp>
#include <Vcl.Graphics.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.Dialogs.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TButton *Button1;
TPaintBox *PaintBox1;
TButton *Button3;
TEdit *Edit1;
void __fastcall Button1Click(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);
void __fastcall Button3Click(TObject *Sender);

private:
TPoint LastCircleCenter; // Центральная точка последней окружности
int LastCircleRadius; // Радиус последней окружности

public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif в Unit1.cpp - //---------------------------------------------------------------------------
#include <vcl.h>
#include <windows.h>
#include // Для std::rand() и std::srand()
#include // Для std::time()
#include // Для использования cos и sin
#include // Для использования std::vector
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
std::srand(static_cast(std::time(0))); // Призыв генератора случайных чисел
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
// Получаем размеры PaintBox1
int width = PaintBox1->Width;
int height = PaintBox1->Height;


        // Генерируем случайные параметры для окружности
LastCircleRadius = std::rand() % 100 + 50; // Радиус от 50 до 150
int x = std::rand() % (width - LastCircleRadius * 2) + LastCircleRadius; // Позиция X
        int y = std::rand() % (height - LastCircleRadius * 2) + LastCircleRadius; // Позиция Y

        // Рисование окружности
        TCanvas *canvas = PaintBox1->Canvas;
        canvas->Brush->Color = clBlue; // Цвет заливки
        canvas->Ellipse(x - LastCircleRadius, y - LastCircleRadius, x + LastCircleRadius, y + LastCircleRadius); // Рисуем окружность

// Сохраняем координаты окружности для дальнейшего использования
        LastCircleCenter = TPoint(x, y);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
PaintBox1->Invalidate(); // Это заставит PaintBox перерисоваться
PaintBox1->Update(); // Обновление PaintBox немедленно
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
// Проверяем, была ли нарисована окружность
if (LastCircleRadius <= 0)
{
ShowMessage("Сначала нарисуйте окружность!");
return;
}


// ЗДЕСЬ должен быть обработчик триангуляции
}
//---------------------------------------------------------------------------  Включая переенос всех функций из первого кода и их переделывание для плоскости, имеющей вид окружности