Aspose.3D for .NET 17.11-2017年11月

其他改进和变化

钥匙摘要类别
THREEDNET-303添加对导入RVM二进制 (AVEVA PDMS) 的支持新功能
THREEDNET-305添加对合并网格的支持新功能
THREEDNET-306FBX GLTF-GLTF中的不正确材料不透明度Bug

公共API和向后不兼容的更改

请参阅对公共API所做的任何更改的列表,如添加、重命名、删除或不推荐使用的成员,以及对Aspose.3D for .NET所做的任何非向后兼容的更改。如果您对列出的任何更改有疑问,请在Aspose.3D支持论坛

将RvmText和RvmBinary成员添加到Aspose.ThreeD.FileFormat类

C#

 /// <summary>

/// AVEVA Plant Design Management System Model in text format

/// </summary>

public static readonly FileFormat RvmText;

/// <summary>

/// AVEVA Plant Design Management System Model in binary format

/// </summary>

public static readonly FileFormat RvmBinary;

PDMS RVM文件支持自动格式检测,因此开发人员可以直接使用场景类的构造函数导入它,而无需显式指定文件格式。

C#

 Scene scene = new Scene("stablizer.rvm");

添加Aspose.ThreeD.Formats.Rvmloadopions类

CylinderRadialSegments,disidiadiudesegments和TorusTubularSegments的属性用于控制将Rvm文件中定义的原语转换为网格的方式。详细信息可以在类Aspose.ThreeD.Entities.Cylinder和Aspose.ThreeD.Entities.Torus中找到

C#

 /// <summary>

/// Load options for AVEVA Plant Design Management System's RVM file.

/// </summary>

public class RvmLoadOptions : LoadOptions

{

    /// <summary>

    /// The RVM file contains no material information, but the Aspose.3D can generate materials for each objects.

    /// Default value is true

    /// </summary>

    public bool GenerateMaterials { get; set; }

    /// <summary>

    /// Gets or sets the number of cylinder's radial segments, default value is 16

    /// </summary>

    public int CylinderRadialSegments { get; set; }

    /// <summary>

    /// Gets or sets the number of dish's longitude segments, default value is 12

    /// </summary>

    public int DishLongitudeSegments { get; set; }

    /// <summary>

    /// Gets or sets the number of dish's latitude segments, default value is 8

    /// </summary>

    public int DishLatitudeSegments { get; set; }

    /// <summary>

    /// Gets or sets the number of torus's tubular segments, default value is 20

    /// </summary>

    public int TorusTubularSegments { get; set; }

    /// <summary>

    /// Construct a <see cref="RvmLoadOptions"/> instance

    /// </summary>

    /// <param name="contentType"></param>

    public RvmLoadOptions(FileContentType contentType);

    /// <summary>

    /// Construct a <see cref="RvmLoadOptions"/> instance

    /// </summary>

    public RvmLoadOptions();

}

示例代码:

C#

 Scene scene = new Scene();

var opt = new RvmLoadOptions()

{

    CylinderRadialSegments = 32,

    DishLatitudeSegments = 16,

    DishLongitudeSegments = 24,

    TorusTubularSegments = 40

};

scene.Open("LAD-TOP.rvm", opt);

scene.Save("LAD-TOP.obj", FileFormat.WavefrontOBJ);

3个成员被添加到Aspose.ThreeD.Entities.Polygonmodiament类中

C#

 /// <summary>

/// Convert a whole node to a single transformed mesh

/// Vertex elements like normal/texture coordinates are not supported yet

/// </summary>

/// <param name="node">The node to merge</param>

/// <returns>Merged mesh</returns>

public static Mesh MergeMesh(Node node)

/// <summary>

/// Convert a whole scene to a single transformed mesh

/// Vertex elements like normal/texture coordinates are not supported yet

/// </summary>

/// <param name="scene">The scene to merge</param>

/// <returns>The merged mesh</returns>

public static Mesh MergeMesh(Scene scene);

/// <summary>

/// Convert a whole node to a single transformed mesh

/// Vertex elements like normal/texture coordinates are not supported yet

/// </summary>

/// <param name="nodes">The nodes to merge</param>

/// <returns>Merged mesh</returns>

public static Mesh MergeMesh(IList<Node> nodes);

示例代码:

C#

 Scene scene = new Scene("LAD-TOP.rvm");

Mesh mesh = PolygonModifier.MergeMesh(scene);

FileFormat.PLY.EncodeMesh(mesh, "LAD-TOP.ply");

透明度成员被添加到Aspose.ThreeD.Shading.PbrMaterial类

只有GLTF 2.0支持PBR材料,因此这种改进只影响GLTF 2.0出口。

C#

 /// <summary>

///  Gets or sets the transparency factor.

/// The factor should be ranged between 0(0%, fully opaque) and 1(100%, fully transparent)

/// Any invalid factor value will be clamped.

/// </summary>

/// <value>The transparency factor.</value>

public double Transparency { get; set; }

示例代码:

C#

 Scene scene = new Scene();

scene.RootNode.CreateChildNode("box", new Box()).Material = new PbrMaterial() {Transparency = 0.5, Albedo = new Vector3(Color.AliceBlue)};

scene.Save("box.gltf", FileFormat.GLTF2);

使用示例

请查看Aspose.3D Wiki docs中添加或更新的帮助主题列表:

  1. 合并3D文件中的网格
  2. 使用RVM加载选项