ChordTolerance
ChordTolerance
#Overview
name: ChordTolerance
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 31
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ChordTolerance is to control the accuracy of tessellation in CAD model importing and rendering within Unreal Engine 5. Here’s a detailed breakdown:
-
Purpose: The ChordTolerance variable is used to define the maximum distance between any generated triangle and the original surface during the tessellation process. It’s a key parameter for controlling the quality and detail of imported CAD models.
-
Subsystems and modules: This variable is primarily used in the DatasmithCADImporter plugin and related CAD import modules. It’s also utilized in the CADKernel and ParametricSurface modules for tessellation operations.
-
Value setting: The value is typically set through import options or tessellation settings. It can be configured in the Datasmith import settings, CAD import options, or programmatically when calling tessellation functions.
-
Interacting variables: ChordTolerance often works in conjunction with other tessellation parameters like MaxEdgeLength and NormalTolerance to control the overall quality of the tessellation.
-
Developer awareness: Developers should be aware that smaller ChordTolerance values will result in more accurate representations of curved surfaces but will also generate more triangles, potentially impacting performance and memory usage.
-
Best practices:
- Choose a ChordTolerance value that balances accuracy and performance for your specific use case.
- Consider the scale of your models when setting this value, as it’s typically in scene units (often centimeters).
- Use in combination with MaxEdgeLength and NormalTolerance for optimal tessellation results.
- Be cautious of setting extremely small values, as this can lead to excessive triangle counts and potential performance issues.
- Default value is often around 0.2 cm, but this may need adjustment based on the specific requirements of your project.
By carefully tuning the ChordTolerance, developers can achieve the right balance between visual fidelity and performance when importing and rendering CAD models in Unreal Engine 5.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Plugins/Enterprise/DatasmithImporter/Config/BaseDatasmithImporter.ini:6, section: [FileProducerTessellationOptions]
- INI Section:
FileProducerTessellationOptions
- Raw value:
0.3
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/CADKernelSurface/Private/CADKernelSurfaceExtension.cpp:37
Scope (from outer to inner):
file
function bool UCADKernelParametricSurfaceData::Tessellate
Source code excerpt:
CADLibrary::FImportParameters ImportParameters;
ImportParameters.SetModelCoordinateSystem((FDatasmithUtils::EModelCoordSystem) SceneParameters.ModelCoordSys);
ImportParameters.SetTesselationParameters(RetessellateOptions.ChordTolerance, RetessellateOptions.MaxEdgeLength, RetessellateOptions.NormalTolerance, (CADLibrary::EStitchingTechnique) RetessellateOptions.StitchingTechnique);
CADLibrary::FMeshParameters CadMeshParameters;
CadMeshParameters.bNeedSwapOrientation = MeshParameters.bNeedSwapOrientation;
CadMeshParameters.bIsSymmetric = MeshParameters.bIsSymmetric;
CadMeshParameters.SymmetricNormal = (FVector3f) MeshParameters.SymmetricNormal;
CadMeshParameters.SymmetricOrigin = (FVector3f) MeshParameters.SymmetricOrigin;
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/CADKernelSurface/Public/CADModelToCADKernelConverterBase.h:71
Scope (from outer to inner):
file
class class FCADModelToCADKernelConverterBase : public CADLibrary::ICADModelConverter
function virtual void SetImportParameters
Source code excerpt:
}
virtual void SetImportParameters(double ChordTolerance, double MaxEdgeLength, double NormalTolerance, CADLibrary::EStitchingTechnique StitchingTechnique) override
{
ImportParameters.SetTesselationParameters(ChordTolerance, MaxEdgeLength, NormalTolerance, StitchingTechnique);
}
virtual bool IsSessionValid() override
{
return true;
}
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/CADTools/Private/CADOption.cpp:160
Scope (from outer to inner):
file
namespace CADLibrary
function uint32 GetTypeHash
Source code excerpt:
{
uint32 ParametersHash = ::GetTypeHash(ImportParameters.bGDisableCADKernelTessellation);
ParametersHash = HashCombine(ParametersHash, ::GetTypeHash(ImportParameters.ChordTolerance));
ParametersHash = HashCombine(ParametersHash, ::GetTypeHash(ImportParameters.MaxEdgeLength));
ParametersHash = HashCombine(ParametersHash, ::GetTypeHash(ImportParameters.MaxNormalAngle));
ParametersHash = HashCombine(ParametersHash, ::GetTypeHash(ImportParameters.StitchingTechnique));
return ParametersHash;
}
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/CADTools/Public/CADOptions.h:49
Scope (from outer to inner):
file
namespace CADLibrary
class class FImportParameters
Source code excerpt:
{
private:
double ChordTolerance;
double MaxEdgeLength;
double MaxNormalAngle;
EStitchingTechnique StitchingTechnique;
EMesher Mesher;
FDatasmithUtils::EModelCoordSystem ModelCoordSys;
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/CADTools/Public/CADOptions.h:77
Scope (from outer to inner):
file
namespace CADLibrary
class class FImportParameters
function FImportParameters
Source code excerpt:
public:
FImportParameters(FDatasmithUtils::EModelCoordSystem NewCoordinateSystem = FDatasmithUtils::EModelCoordSystem::ZUp_RightHanded)
: ChordTolerance(0.2)
, MaxEdgeLength(0.0)
, MaxNormalAngle(20.0)
, StitchingTechnique(EStitchingTechnique::StitchingNone)
, Mesher(EMesher::TechSoft)
, ModelCoordSys(NewCoordinateSystem)
{
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/CADTools/Public/CADOptions.h:87
Scope (from outer to inner):
file
namespace CADLibrary
class class FImportParameters
function FImportParameters
Source code excerpt:
FImportParameters(const FImportParameters& InParamneters, EMesher InMesher)
: ChordTolerance(InParamneters.ChordTolerance)
, MaxEdgeLength(InParamneters.MaxEdgeLength)
, MaxNormalAngle(InParamneters.MaxNormalAngle)
, StitchingTechnique(InParamneters.StitchingTechnique)
, Mesher(InMesher)
, ModelCoordSys(InParamneters.ModelCoordSys)
{
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/CADTools/Public/CADOptions.h:98
Scope (from outer to inner):
file
namespace CADLibrary
class class FImportParameters
function void SetTesselationParameters
Source code excerpt:
void SetTesselationParameters(double InChordTolerance, double InMaxEdgeLength, double InMaxNormalAngle, EStitchingTechnique InStitchingTechnique)
{
ChordTolerance = InChordTolerance * GMeshingParameterFactor;
MaxEdgeLength = InMaxEdgeLength * GMeshingParameterFactor;
MaxNormalAngle = InMaxNormalAngle;
StitchingTechnique = InStitchingTechnique;
Mesher = FImportParameters::bGDisableCADKernelTessellation ? EMesher::TechSoft : EMesher::CADKernel;
}
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/CADTools/Public/CADOptions.h:114
Scope (from outer to inner):
file
namespace CADLibrary
class class FImportParameters
function uint32 GetHash
Source code excerpt:
{
uint32 Hash = 0;
for (double Param : {ChordTolerance, MaxEdgeLength, MaxNormalAngle, (double) GStitchingForceFactor})
{
Hash = HashCombine(Hash, ::GetTypeHash(Param));
}
for (uint32 Param : {uint32(StitchingTechnique), uint32(Mesher), uint32(ModelCoordSys)})
{
Hash = HashCombine(Hash, ::GetTypeHash(Param));
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/CADTools/Public/CADOptions.h:131
Scope (from outer to inner):
file
namespace CADLibrary
class class FImportParameters
function FArchive& operator<<
Source code excerpt:
friend FArchive& operator<<(FArchive& Ar, FImportParameters& ImportParameters)
{
Ar << ImportParameters.ChordTolerance;
Ar << ImportParameters.MaxEdgeLength;
Ar << ImportParameters.MaxNormalAngle;
Ar << (uint32&) ImportParameters.StitchingTechnique;
Ar << (uint8&) ImportParameters.Mesher;
Ar << (uint8&) ImportParameters.ModelCoordSys;
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/CADTools/Public/CADOptions.h:163
Scope (from outer to inner):
file
namespace CADLibrary
class class FImportParameters
function double GetChordTolerance
Source code excerpt:
double GetChordTolerance() const
{
return ChordTolerance;
}
double GetMaxNormalAngle() const
{
return MaxNormalAngle;
}
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/DatasmithCADTranslator/Private/DatasmithCADTranslator.cpp:175
Scope (from outer to inner):
file
function bool FDatasmithCADTranslator::LoadScene
Source code excerpt:
};
ImportParameters.SetTesselationParameters(CheckParameterValue(TesselationOptions.ChordTolerance, UE::DatasmithTessellation::MinTessellationChord, TEXT("Chord tolerance")),
FMath::IsNearlyZero(TesselationOptions.MaxEdgeLength) ? 0. : CheckParameterValue(TesselationOptions.MaxEdgeLength, UE::DatasmithTessellation::MinTessellationEdgeLength, TEXT("Max Edge Length")),
CheckParameterValue(TesselationOptions.NormalTolerance, UE::DatasmithTessellation::MinTessellationAngle, TEXT("Max Angle")),
(EStitchingTechnique)TesselationOptions.StitchingTechnique);
ImportParameters.SetModelCoordinateSystem(FDatasmithUtils::EModelCoordSystem::ZUp_RightHanded);
UE_LOG(LogCADTranslator, Display, TEXT(" - Import parameters:"));
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/DatasmithOpenNurbsTranslator/Private/DatasmithOpenNurbsImportOptions.cpp:28
Scope (from outer to inner):
file
function bool UDatasmithOpenNurbsImportOptions::CanEditChange
Source code excerpt:
return true;
}
else if (PropertyFName == GET_MEMBER_NAME_CHECKED(FDatasmithOpenNurbsOptions, ChordTolerance)
|| PropertyFName == GET_MEMBER_NAME_CHECKED(FDatasmithOpenNurbsOptions, MaxEdgeLength)
|| PropertyFName == GET_MEMBER_NAME_CHECKED(FDatasmithOpenNurbsOptions, NormalTolerance)
|| PropertyFName == GET_MEMBER_NAME_CHECKED(FDatasmithOpenNurbsOptions, StitchingTechnique)
)
{
// Enable tessellation options only when using CAD library to tessellate
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/DatasmithOpenNurbsTranslator/Private/DatasmithOpenNurbsTranslator.cpp:2979
Scope (from outer to inner):
file
function bool FOpenNurbsTranslatorImpl::TranslateBRep
Source code excerpt:
{
// Ref. visitBRep
CADModelConverter->SetImportParameters(OpenNurbsOptions.ChordTolerance, OpenNurbsOptions.MaxEdgeLength, OpenNurbsOptions.NormalTolerance, (CADLibrary::EStitchingTechnique)OpenNurbsOptions.StitchingTechnique);
CADModelConverter->InitializeProcess();
OpenNurbsBRepConverter->AddBRep(*Brep, Offset);
CADModelConverter->RepairTopology();
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/DatasmithPLMXMLTranslator/Private/DatasmithPlmXmlImporter.cpp:251
Scope (from outer to inner):
file
namespace PlmXml
class class FPlmXmlMeshLoaderWithDatasmithDispatcher
function FPlmXmlMeshLoaderWithDatasmithDispatcher
Source code excerpt:
// Setup of import parameters for DatasmithDispatcher copied from FDatasmithCADTranslator's setup
ImportParameters.SetTesselationParameters(TessellationOptions.ChordTolerance, TessellationOptions.MaxEdgeLength, TessellationOptions.NormalTolerance, (CADLibrary::EStitchingTechnique) TessellationOptions.StitchingTechnique);
DatasmithDispatcher = MakeUnique<DatasmithDispatcher::FDatasmithDispatcher>(ImportParameters, CacheDir, CADFileToUEFileMap, CADFileToUEGeomMap);
}
// Adds geom file to load and returns Id to use in InstantiateMesh later(after all is loaded)
int32 AddMeshToLoad(const FString& FullPath)
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/DatasmithPLMXMLTranslator/Private/DatasmithPlmXmlTranslator.cpp:84
Scope (from outer to inner):
file
function bool FDatasmithPlmXmlTranslator::LoadScene
Source code excerpt:
};
CommonTessellationOptions.ChordTolerance = CheckParameterValue(CommonTessellationOptions.ChordTolerance, UE::DatasmithTessellation::MinTessellationChord, TEXT("Chord tolerance"));
CommonTessellationOptions.MaxEdgeLength = FMath::IsNearlyZero(CommonTessellationOptions.MaxEdgeLength) ? 0. : CheckParameterValue(CommonTessellationOptions.MaxEdgeLength, UE::DatasmithTessellation::MinTessellationEdgeLength, TEXT("Max Edge Length"));
CommonTessellationOptions.NormalTolerance = CheckParameterValue(CommonTessellationOptions.NormalTolerance, UE::DatasmithTessellation::MinTessellationAngle, TEXT("Max Angle"));
UE_LOG(LogDatasmithXMLPLMTranslator, Display, TEXT(" - Import parameters:"));
UE_LOG(LogDatasmithXMLPLMTranslator, Display, TEXT(" - ChordTolerance: %f"), CommonTessellationOptions.ChordTolerance);
UE_LOG(LogDatasmithXMLPLMTranslator, Display, TEXT(" - MaxEdgeLength: %f"), CommonTessellationOptions.MaxEdgeLength);
UE_LOG(LogDatasmithXMLPLMTranslator, Display, TEXT(" - MaxNormalAngle: %f"), CommonTessellationOptions.NormalTolerance);
FString StitchingTechnique;
switch ((EStitchingTechnique)CommonTessellationOptions.StitchingTechnique)
{
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/DatasmithWireTranslator/Private/DatasmithWireTranslator.cpp:480
Scope (from outer to inner):
file
namespace UE_DATASMITHWIRETRANSLATOR_NAMESPACE
function void FWireTranslatorImpl::SetTessellationOptions
Source code excerpt:
{
TessellationOptions = Options;
CADModelConverter->SetImportParameters(Options.ChordTolerance, Options.MaxEdgeLength, Options.NormalTolerance, (CADLibrary::EStitchingTechnique)Options.StitchingTechnique);
SceneFileHash = HashCombine(Options.GetHash(), GetSceneFileHash(SceneFullPath, SceneName));
}
bool FWireTranslatorImpl::Read()
{
// Initialize Alias.
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/DatasmithWireTranslator/Private/DatasmithWireTranslator.cpp:2128
Scope (from outer to inner):
file
namespace UE_DATASMITHWIRETRANSLATOR_NAMESPACE
function TOptional<FMeshDescription> FWireTranslatorImpl::GetMeshOfShellNode
Source code excerpt:
DagNode.inverseGlobalTransformationMatrix(AlMatrix);
// TODO: the best way, should be to don't have to apply inverse global transform to the generated mesh
TSharedPtr<AlDagNode> TesselatedNode = OpenModelUtils::TesselateDagLeaf(DagNode, ETesselatorType::Fast, TessellationOptions.ChordTolerance);
if (TesselatedNode.IsValid())
{
// Get the meshes from the dag nodes. Note that removing the mesh's DAG.
// will also removes the meshes, so we have to do it later.
TOptional<FMeshDescription> UEMesh = GetMeshOfNodeMesh(*TesselatedNode, MeshElement, MeshParameters, &AlMatrix);
return UEMesh;
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/DatasmithWireTranslator/Private/DatasmithWireTranslator.cpp:2434
Scope (from outer to inner):
file
namespace UE_DATASMITHWIRETRANSLATOR_NAMESPACE
function bool FDatasmithWireTranslator::LoadScene
Source code excerpt:
const FDatasmithTessellationOptions& TessellationOptions = GetCommonTessellationOptions();
UE_LOG(LogDatasmithWireTranslator, Display, TEXT(" - ChordTolerance: %lf"), TessellationOptions.ChordTolerance);
UE_LOG(LogDatasmithWireTranslator, Display, TEXT(" - MaxEdgeLength: %lf"), TessellationOptions.MaxEdgeLength);
UE_LOG(LogDatasmithWireTranslator, Display, TEXT(" - MaxNormalAngle: %lf"), TessellationOptions.NormalTolerance);
FString StitchingTechnique;
switch (TessellationOptions.StitchingTechnique)
{
case EDatasmithCADStitchingTechnique::StitchingHeal:
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/ParametricSurface/Private/TechSoft/TechSoftParametricSurface.cpp:36
Scope (from outer to inner):
file
function bool UTechSoftParametricSurfaceData::Tessellate
Source code excerpt:
{
CADLibrary::FImportParameters ImportParameters((FDatasmithUtils::EModelCoordSystem)SceneParameters.ModelCoordSys);
ImportParameters.SetTesselationParameters(RetessellateOptions.ChordTolerance, RetessellateOptions.MaxEdgeLength, RetessellateOptions.NormalTolerance, (CADLibrary::EStitchingTechnique)RetessellateOptions.StitchingTechnique);
FMeshConversionContext Context(ImportParameters, MeshParameters);
CADLibrary::FTechSoftInterface& TechSoftInterface = CADLibrary::FTechSoftInterface::Get();
bSuccessfulTessellation = TechSoftInterface.InitializeKernel(*FPaths::EnginePluginsDir());
if (bSuccessfulTessellation)
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/ParametricSurface/Public/CADModelConverter.h:46
Scope (from outer to inner):
file
namespace CADLibrary
class class ICADModelConverter
Source code excerpt:
* Set Import parameters,
* Tack care to set scale factor before because import parameters will be scale according to scale factor
* @param ChordTolerance : SAG
* @param MaxEdgeLength : max length of element's edge
* @param NormalTolerance : Angle between two adjacent triangles
* @param StitchingTechnique : CAD topology correction technique
* @param bScaleUVMap : Scale the UV map to a world unit.
*/
virtual void SetImportParameters(double ChordTolerance, double MaxEdgeLength, double NormalTolerance, CADLibrary::EStitchingTechnique StitchingTechnique) = 0;
virtual bool IsSessionValid() = 0;
virtual void AddSurfaceDataForMesh(const TCHAR* InFilePath, const FMeshParameters& InMeshParameters, const FDatasmithTessellationOptions& InTessellationOptions, FDatasmithMeshElementPayload& OutMeshPayload) const = 0;
};
}
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/ParametricSurface/Public/CADModelToTechSoftConverterBase.h:37
Scope (from outer to inner):
file
class class FCADModelToTechSoftConverterBase : public CADLibrary::ICADModelConverter
function virtual void SetImportParameters
Source code excerpt:
virtual bool Tessellate(const CADLibrary::FMeshParameters& InMeshParameters, FMeshDescription& OutMeshDescription) override;
virtual void SetImportParameters(double ChordTolerance, double MaxEdgeLength, double NormalTolerance, CADLibrary::EStitchingTechnique StitchingTechnique) override
{
ImportParameters.SetTesselationParameters(ChordTolerance, MaxEdgeLength, NormalTolerance, StitchingTechnique);
}
virtual bool IsSessionValid() override
{
return true;
}
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/ParametricSurfaceExtension/Private/DataprepTessellationOperation.cpp:24
Scope (from outer to inner):
file
function void UDataprepTessellationOperation::PostLoad
Source code excerpt:
void UDataprepTessellationOperation::PostLoad()
{
if( HasAnyFlags(RF_WasLoaded) && TessellationSettings_DEPRECATED.ChordTolerance != -MAX_FLT)
{
ChordTolerance = TessellationSettings_DEPRECATED.ChordTolerance;
MaxEdgeLength = TessellationSettings_DEPRECATED.MaxEdgeLength;
NormalTolerance = TessellationSettings_DEPRECATED.NormalTolerance;
// Mark TessellationSettings_DEPRECATED as non usable
TessellationSettings_DEPRECATED.ChordTolerance = -MAX_FLT;
}
Super::PostLoad();
}
void UDataprepTessellationOperation::OnExecution_Implementation(const FDataprepContext& InContext)
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/ParametricSurfaceExtension/Private/DataprepTessellationOperation.h:24
Scope (from outer to inner):
file
class class UDataprepTessellationOperation : public UDataprepOperation
function UDataprepTessellationOperation
Source code excerpt:
UDataprepTessellationOperation()
: ChordTolerance(0.2f)
, MaxEdgeLength(0.0f)
, NormalTolerance(20.0f)
// Mark TessellationSettings_DEPRECATED as non usable
, TessellationSettings_DEPRECATED(-MAX_FLT)
{
}
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/ParametricSurfaceExtension/Private/DataprepTessellationOperation.h:44
Scope (from outer to inner):
file
class class UDataprepTessellationOperation : public UDataprepOperation
Source code excerpt:
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Tessellation Options", meta = (Units = cm, ToolTip = "Maximum distance between any generated triangle and the original surface. Smaller values make more triangles.", ClampMin = "0.0"))
float ChordTolerance;
/**
* Maximum length of edges of triangles generated by the tessellation process.
* The length is in scene/model unit. The smaller the more triangles are generated.
* Value of 0 means no constraint on length of edges
* Default value is 0.
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithContent/Source/DatasmithContent/Public/DatasmithImportOptions.h:224
Scope (from outer to inner):
file
function FDatasmithTessellationOptions
Source code excerpt:
FDatasmithTessellationOptions(float InChordTolerance = 0.2f, float InMaxEdgeLength = 0.0f, float InNormalTolerance = 20.0f, EDatasmithCADStitchingTechnique InStitchingTechnique = EDatasmithCADStitchingTechnique::StitchingSew)
: ChordTolerance(InChordTolerance)
, MaxEdgeLength(InMaxEdgeLength)
, NormalTolerance(InNormalTolerance)
, StitchingTechnique(InStitchingTechnique)
{
}
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithContent/Source/DatasmithContent/Public/DatasmithImportOptions.h:237
Scope: file
Source code excerpt:
*/
UPROPERTY(config, EditAnywhere, BlueprintReadWrite, Category = "Geometry & Tessellation Options", meta = (Units = cm, ToolTip = "Maximum distance between any generated triangle and the original surface. Smaller values make more triangles.", ClampMin = "0.005"))
float ChordTolerance;
/**
* Maximum length of edges of triangles generated by the tessellation process.
* The length is in scene/model unit. The smaller the more triangles are generated.
* Value of 0 means no constraint on length of edges
* Default value is 0 to disable this criteria, and 1. cm is its minimal value if enable.
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithContent/Source/DatasmithContent/Public/DatasmithImportOptions.h:273
Scope (from outer to inner):
file
function bool operator ==
Source code excerpt:
bool operator == (const FDatasmithTessellationOptions& Other) const
{
return FMath::IsNearlyEqual(ChordTolerance, Other.ChordTolerance)
&& FMath::IsNearlyEqual(MaxEdgeLength, Other.MaxEdgeLength)
&& FMath::IsNearlyEqual(NormalTolerance, Other.NormalTolerance)
&& StitchingTechnique == Other.StitchingTechnique;
}
uint32 GetHash() const
{
uint32 Hash = uint32(StitchingTechnique);
for (float Param : {ChordTolerance, MaxEdgeLength, NormalTolerance})
{
Hash = HashCombine(Hash, GetTypeHash(Param));
}
return Hash;
}
};
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithContent/Source/DatasmithContent/Public/DatasmithImportOptions.h:307
Scope (from outer to inner):
file
function void operator =
Source code excerpt:
void operator = (const FDatasmithTessellationOptions& Other)
{
ChordTolerance = Other.ChordTolerance;
MaxEdgeLength = Other.MaxEdgeLength;
NormalTolerance = Other.NormalTolerance;
StitchingTechnique = Other.StitchingTechnique;
}
};
#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithImporter/Source/DatasmithImporter/Private/DatasmithFileProducer.cpp:1927
Scope (from outer to inner):
file
function void UDatasmithFileProducer::LoadDefaultSettings
Source code excerpt:
{
GConfig->GetFloat( TessellationSectionName, TEXT("ChordTolerance"), DefaultTessellationOptions.ChordTolerance, DatasmithImporterIni);
GConfig->GetFloat( TessellationSectionName, TEXT("MaxEdgeLength"), DefaultTessellationOptions.MaxEdgeLength, DatasmithImporterIni);
GConfig->GetFloat( TessellationSectionName, TEXT("NormalTolerance"), DefaultTessellationOptions.NormalTolerance, DatasmithImporterIni);
FString StitchingTechnique = GConfig->GetStr( TessellationSectionName, TEXT("StitchingTechnique"), DatasmithImporterIni);
if(StitchingTechnique == TEXT("StitchingHeal"))
{
#Loc: <Workspace>/Engine/Source/Runtime/Datasmith/CADKernel/Private/CADKernel/Geo/Sampling/SurfacicPolyline.cpp:26
Scope (from outer to inner):
file
namespace UE::CADKernel
function FSurfacicPolyline::FSurfacicPolyline
Source code excerpt:
}
FSurfacicPolyline::FSurfacicPolyline(TSharedRef<FSurface> InCarrierSurface, TSharedRef<FCurve> Curve2D, const double ChordTolerance, const double ParamTolerance, bool bInWithNormals, bool bInWithTangents)
: bWithNormals(bInWithNormals)
, bWithTangent(bInWithTangents)
{
FSurfacicCurveSamplerOnParam Sampler(InCarrierSurface.Get(), Curve2D.Get(), Curve2D->GetBoundary(), ChordTolerance, ParamTolerance, *this);
Sampler.Sample();
BoundingBox.Set(Points2D);
}
void FSurfacicPolyline::CheckIfDegenerated(const double Tolerance3D, const FSurfacicTolerance& ToleranceIso, const FLinearBoundary& Boudary, bool& bDegeneration2D, bool& bDegeneration3D, double& Length3D) const
{
#Loc: <Workspace>/Engine/Source/Runtime/Datasmith/CADKernel/Public/CADKernel/Geo/Sampling/SurfacicPolyline.h:46
Scope (from outer to inner):
file
namespace UE::CADKernel
class class FSurfacicPolyline
Source code excerpt:
FSurfacicPolyline(TSharedRef<FSurface> InCarrierSurface, TSharedRef<FCurve> InCurve2D, const double Tolerance);
FSurfacicPolyline(TSharedRef<FSurface> InCarrierSurface, TSharedRef<FCurve> InCurve2D, const double ChordTolerance, const double ParamTolerance, bool bInWithNormals/* = false*/, bool bWithTangent/* = false*/);
FSurfacicPolyline(bool bInWithNormals = false, bool bInWithTangent = false)
: bWithNormals(bInWithNormals)
, bWithTangent(bInWithTangent)
{
}