```
private BlockPrimitive recordConstrainPolygonFigure(
/*Parameter with token 08001FF4*/ReferencePointUV centerRefPoint,
/*Parameter with token 08001FF5*/ReferencePointUV radiusRefPoint,
/*Parameter with token 08001FF6*/int sides,
/*Parameter with token 08001FF7*/bool circumscribed,
/*Parameter with token 08001FF8*/bool display,
/*Parameter with token 08001FF9*/bool isFixed)
{
this.openChangeTransaction();
PointUV point = centerRefPoint.Point;
PointUV pointUv = radiusRefPoint.Point;
AngleUV angleUv1 = AngleUV.TWO_PI.divideBy((double) sides);
AngleUV.PI.subtract(angleUv1);
double radius1 = pointUv.distance(point);
ReferenceAxisUV refFigureB = (ReferenceAxisUV) null;
BlockPrimitive blockPrimitive1 = this.implementNewCirclePrimitive(centerRefPoint, radius1, false, isFixed, false);
ReferenceCircleUV referenceFigureLocal1 = (ReferenceCircleUV) blockPrimitive1.PrimaryReferenceFigureLocal;
if (!circumscribed)
{
AngleUV angle = point.findAngle(pointUv);
AngleUV angleUv2 = angleUv1.divideBy(2.0);
double tangent = angleUv2.Tangent; // tangent is unused - this line should be deleted.
double radius2 = radius1 / angleUv2.Cosine;
pointUv = point.getRadialPoint(angleUv2.add(angle), radius2);
radiusRefPoint = this.newReferencePointLocal(pointUv);
radius1 = pointUv.distance(point);
}
AngleUV angle1 = point.findAngle(pointUv);
PointUV[] pointUvArray = new PointUV[sides];
ReferencePointUV[] referencePointUvArray = new ReferencePointUV[sides];
com.objectspace.jgl.Array items = new com.objectspace.jgl.Array(sides);
int index1 = 0;
pointUvArray[index1] = pointUv;
referencePointUvArray[index1] = radiusRefPoint;
if (circumscribed)
this.recordConstrainCoincident((ReferenceFigureUV) referenceFigureLocal1, (ReferenceFigureUV) referencePointUvArray[index1]);
AngleUV angleUv3 = angle1.add(angleUv1);
for (int index2 = 1; index2 < sides; ++index2)
{
pointUvArray[index2] = new PointUV(point.u + angleUv3.Cosine * radius1, point.v + angleUv3.Sine * radius1);
referencePointUvArray[index2] = this.newReferencePointLocal(pointUvArray[index2]);
if (circumscribed)
this.recordConstrainCoincident((ReferenceFigureUV) referenceFigureLocal1, (ReferenceFigureUV) referencePointUvArray[index2]);
LineUV lineUv = new LineUV(pointUvArray[index2 - 1], pointUvArray[index2]);
BlockPrimitive blockPrimitive2 = new BlockPrimitive((FigureUV) lineUv, this.HeaderProperties);
this.recordConstrainLine((Primitive) blockPrimitive2, lineUv, referencePointUvArray[index2 - 1], referencePointUvArray[index2]);
ReferenceAxisUV referenceFigureLocal2 = (ReferenceAxisUV) blockPrimitive2.PrimaryReferenceFigureLocal;
if (!circumscribed)
this.recordConstrainTangent((ReferenceFigureUV) referenceFigureLocal1, (object) null, (ReferenceFigureUV) referenceFigureLocal2, (object) null);
refFigureB = referenceFigureLocal2;
this.recordAddPrimitive((Primitive) blockPrimitive2, display, isFixed);
items.add((object) blockPrimitive2);
angleUv3 = angleUv3.add(angleUv1);
}
int index3 = sides - 1;
LineUV lineUv1 = new LineUV(pointUvArray[index3], pointUv);
BlockPrimitive blockPrimitive3 = new BlockPrimitive((FigureUV) lineUv1, this.HeaderProperties);
this.recordConstrainLine((Primitive) blockPrimitive3, lineUv1, referencePointUvArray[index3], referencePointUvArray[0]);
ReferenceAxisUV referenceFigureLocal3 = (ReferenceAxisUV) blockPrimitive3.PrimaryReferenceFigureLocal;
if (!circumscribed)
this.recordConstrainTangent((ReferenceFigureUV) referenceFigureLocal1, (object) null, (ReferenceFigureUV) referenceFigureLocal3, (object) null);
if (refFigureB != null)
this.recordConstrainAngle((ReferenceFigureUV) referenceFigureLocal3, (ReferenceFigureUV) refFigureB, angleUv1, 0);
this.recordAddPrimitive((Primitive) blockPrimitive3, display, isFixed);
this.BlockRelationsConsort.addRelations(512, (Sequence) items, (Sequence) new com.objectspace.jgl.Array(), false);
this.evaluateDefinition();
this.closeChangeTransaction();
return blockPrimitive1;
}
```