本文整理汇总了C#中IFCFile.CreateCartesianPoint方法的典型用法代码示例。如果您正苦于以下问题:C# IFCFile.CreateCartesianPoint方法的具体用法?C# IFCFile.CreateCartesianPoint怎么用?C# IFCFile.CreateCartesianPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFCFile
的用法示例。
在下文中一共展示了IFCFile.CreateCartesianPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateDefaultMappedItem
/// <summary>
/// Creates IfcMappedItem object.
/// </summary>
/// <param name="file">
/// The IFC file.
/// </param>
/// <param name="repMap">
/// The handle to be mapped.
/// </param>
/// <param name="orig">
/// The orig for mapping transformation.
/// </param>
/// <returns>
/// The handle.
/// </returns>
public static IFCAnyHandle CreateDefaultMappedItem(IFCFile file, IFCAnyHandle repMap, XYZ orig)
{
IFCAnyHandle origin = file.CreateCartesianPoint(orig);
IFCMeasureValue scale = IFCMeasureValue.Create(1.0);
IFCAnyHandle mappingTarget =
file.CreateCartesianTransformationOperator3D(IFCAnyHandle.Create(), IFCAnyHandle.Create(), origin, scale, IFCAnyHandle.Create());
return file.CreateMappedItem(repMap, mappingTarget);
}
示例2: CreateCartesianPoint
/// <summary>
/// Creates IfcCartesianPoint object.
/// </summary>
/// <param name="file">
/// The IFC file.
/// </param>
/// <param name="measure">
/// The list of doubles to create the Cartesian point.
/// </param>
/// <returns>
/// The handle.
/// </returns>
public static IFCAnyHandle CreateCartesianPoint(IFCFile file, IList<double> measure)
{
IList<double> cleanMeasure = new List<double>();
foreach (double value in measure)
{
double ceilMeasure = Math.Ceiling(value);
double floorMeasure = Math.Floor(value);
if (MathUtil.IsAlmostEqual(value, ceilMeasure))
cleanMeasure.Add(ceilMeasure);
else if (MathUtil.IsAlmostEqual(value, floorMeasure))
cleanMeasure.Add(floorMeasure);
else
cleanMeasure.Add(value);
}
if (MathUtil.IsAlmostZero(cleanMeasure[0]) && MathUtil.IsAlmostZero(cleanMeasure[1]))
{
if (measure.Count == 2)
{
return ExporterIFCUtils.GetGlobal2DOriginHandle();
}
if (measure.Count == 3 && MathUtil.IsAlmostZero(cleanMeasure[2]))
{
return ExporterIFCUtils.GetGlobal3DOriginHandle();
}
}
IFCAnyHandle pointHandle = file.CreateCartesianPoint(cleanMeasure);
return pointHandle;
}