Add triangulation of polygon

This commit is contained in:
Evgeny Redikultsev
2025-10-26 22:19:25 +05:00
parent 196dc636bb
commit 09dcf4e7e9
52 changed files with 686 additions and 180 deletions

View File

@@ -45,9 +45,12 @@ namespace DataAccess.DTOs
public override INdmPrimitive GetNewItem(INdmPrimitive source)
{
GetMaterial(source.NdmElement.HeadMaterial);
INdmPrimitive newItem = GetNewPrimitive(source);
newItem.NdmElement.HeadMaterial = headMaterial;
if (source.NdmElement.HeadMaterial != null)
{
GetMaterial(source.NdmElement.HeadMaterial);
newItem.NdmElement.HeadMaterial = headMaterial;
}
return newItem;
}
@@ -69,11 +72,23 @@ namespace DataAccess.DTOs
{
return GetRectangle(rectangle);
}
if (source is ShapeNdmPrimitiveDTO shape)
{
return GetShape(shape);
}
string errorString = ErrorStrings.ObjectTypeIsUnknownObj(source);
TraceLogger.AddMessage(errorString, TraceLogStatuses.Error);
throw new StructureHelperException(errorString);
}
private INdmPrimitive GetShape(ShapeNdmPrimitiveDTO shape)
{
TraceLogger?.AddMessage($"{PrimitiveIs} shape ndm primitive");
ShapeNdmPrimitiveFromDTOConvertStrategy convertStrategy = new(this);
IShapeNdmPrimitive shapeNdmPrimitive = convertStrategy.Convert(shape);
return shapeNdmPrimitive;
}
private void GetMaterial(IHeadMaterial source)
{
HeadMaterialFromDTOConvertStrategy convertStrategy = new()