mirror of
https://github.com/eliasstepanik/OSCADSharpDotnet7.git
synced 2026-01-12 22:18:34 +00:00
77 lines
2.5 KiB
C#
77 lines
2.5 KiB
C#
using OSCADSharp.Transforms;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace OSCADSharp
|
|
{
|
|
public abstract class OSCADObject
|
|
{
|
|
#region Transforms
|
|
/// <summary>
|
|
/// Applies Color and/or Opacity to this object
|
|
/// </summary>
|
|
/// <param name="colorName">The name of the color to apply</param>
|
|
/// <param name="opacity">The opacity from 0.0 to 1.0</param>
|
|
/// <returns>A colorized object</returns>
|
|
public OSCADObject Color(string colorName, double opacity = 1.0)
|
|
{
|
|
return new ColoredObject(this, colorName, opacity);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Mirrors the object about a plane, as specified by the normal
|
|
/// </summary>
|
|
/// <param name="normal">The normal vector of the plane intersecting the origin of the object,
|
|
/// through which to mirror it.</param>
|
|
/// <returns>A mirrored object</returns>
|
|
public OSCADObject Mirror(Vector3 normal)
|
|
{
|
|
return new MirroredObject(this, normal);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Resizes to a specified set of X/Y/Z dimensions
|
|
/// </summary>
|
|
/// <param name="newsize">The X/Y/Z dimensions</param>
|
|
/// <returns>A resized object</returns>
|
|
public OSCADObject Resize(Vector3 newsize)
|
|
{
|
|
return new ResizedObject(this, newsize);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Rotates about a specified X/Y/Z euler angle
|
|
/// </summary>
|
|
/// <param name="angle">The angle(s) to rotate</param>
|
|
/// <returns>A rotated object</returns>
|
|
public OSCADObject Rotate(Vector3 angle)
|
|
{
|
|
return new RotatedObject(this, angle);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Rescales an object by an X/Y/Z scale factor
|
|
/// </summary>
|
|
/// <param name="scale">The scale to apply. For example 1, 2, 1 would yield 2x scale on the Y axis</param>
|
|
/// <returns>A scaled object</returns>
|
|
public OSCADObject Scale(Vector3 scale)
|
|
{
|
|
return new ScaledObject(this, scale);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Translates an object by the specified amount
|
|
/// </summary>
|
|
/// <param name="translation">The vector upon which to translate (move object(s))</param>
|
|
/// <returns>A translated object</returns>
|
|
public OSCADObject Translate(Vector3 translation)
|
|
{
|
|
return new TranslatedObject(this, translation);
|
|
}
|
|
#endregion
|
|
}
|
|
}
|