private void initSegments(double With,double Height,double radius) {
        SegmentModel bsegments = new SegmentModel(base.getInterpolated(With,Height,radius));

        segments = new SegmentModel[n];
        double angle = 2*Math.PI/n;
        for (int i = 0; i<segments.length;i++){
            segments[i] = SegmentModel.RotateSegmentByX(bsegments,angle*i);
            segments[i].color  = this.color;
        }
        circles  = new SegmentModel[m+1];
        SegmentModel sm;
        double step = (double)(bsegments.points.length)/m;
        for (int i = 0; i<circles.length; i++){
            sm = new SegmentModel();
            sm.points = new Point3D[(segments.length + 1)*k];
            circles[i] = sm;
            sm.color = this.color;
        }
        Point3D origin;
        ArrayList<Point3D> origins = new ArrayList<Point3D>();
        double cirStep = 2*Math.PI/circles[0].points.length;
        for (int i = 0; i<circles.length;i++){
//            origin = new Point3D(segments[0].points[(int)Math.round(step*i)]);
            for (int j = 0; j<segments.length;j++){
                if(step*i<segments[j].points.length) origin = segments[j].points[(int)Math.round(step*i)];
                else  origin = segments[j].points[segments[j].points.length-1];
                origins.add(origin);
                for (int z = 0; z<=k*2-1;z++){
                    circles[i].points[k*j + z] = MatrixArifmetikModel.RotateByX(origin,angle/k*z);
                }
//                circles[i].points[j] = MatrixArifmetikModel.RotateByX(origin,cirStep*j);
            }
        }
        TriangleContainer tc;
        double[] kd = new double[3];
        kd[0] = 300.1;
        kd[1] = 300.1;
        kd[2] = 300.1;

        for (int i = 0; i<origins.size() - segments.length-1;i++){
            tc = new TriangleContainer();
            tc.leftAnglePoint = origins.get(i);
            tc.rightAnglePoint =origins.get(i+segments.length);
            tc.topAnglePoint = origins.get(i+segments.length+1);
            tc.Kd = kd;
            tc.Kf = kd;
            tc.currentTriangleColor = new Color(125,125,125);
            triangleContainer.add(tc);

            tc = new TriangleContainer();
            tc.leftAnglePoint = origins.get(i);
            tc.rightAnglePoint = origins.get(i+1);
            tc.topAnglePoint = origins.get(i+segments.length+1);
            tc.Kd = kd;
            tc.Kf = kd;
            tc.currentTriangleColor = new Color(125,125,125);
            triangleContainer.add(tc);
        }
//        for(int i = 0; i<circles.length; i++){
//            for (int j = 0; j<circles[i].points.length; j++){
//                if(i<circles.length-1){
//                    if(j != circles[i].points.length-1) circles[i].points[j] = segments[j].points[(int)Math.round(step*i)];
//                    else circles[i].points[j] = circles[i].points[0];
//                }else {
//                    if(j != circles[i].points.length-1) circles[i].points[j] = segments[j].points[bsegments.points.length-1];
//                    else circles[i].points[j] = circles[i].points[0];
//                }
//
//            }
//        }

    }