Class Ext
- Namespace
- SearchAThing.OpenGL.Core
- Assembly
- netcore-opengl-core.dll
public static class Ext
- Inheritance
-
Ext
- Inherited Members
Methods
AspectRatio(in Size)
Compute aspect ratio of given Size object.
public static float AspectRatio(this in Size size)
Parameters
size
Size
Returns
Remarks
If size height is zero returns 1, width / height elsewhere.
AverageColor(IGLLine)
Average color of lines vertexes color.
public static Color AverageColor(this IGLLine line)
Parameters
line
IGLLine
Returns
BaseX(in Matrix4x4)
Extract basex (m1[1..3]) from the given world matrix.
public static Vector3 BaseX(this in Matrix4x4 m)
Parameters
Returns
BaseY(in Matrix4x4)
Extract basey (m2[1..3]) from the given world matrix.
public static Vector3 BaseY(this in Matrix4x4 m)
Parameters
Returns
BaseZ(in Matrix4x4)
Extract basez (m3[1..3]) from the given world matrix.
public static Vector3 BaseZ(this in Matrix4x4 m)
Parameters
Returns
BuildVertexPosDict(IGLFigure, float)
From given figure create a vertex position based dictionary suitable to be queries through vertex PositionSignature(Vector3, float).
public static Dictionary<string, List<GLVertex>> BuildVertexPosDict(this IGLFigure figure, float tol)
Parameters
figure
IGLFigureGl figure which retrieve vertexes.
tol
floatVertex position tolerance to group them.
Returns
- Dictionary<string, List<GLVertex>>
Dictionary gl vertex position signature to list of gl vertexes within that position.
BuildVertexPosDict(IEnumerable<IGLFigure>, float)
From given list of figures create a vertex position based dictionary suitable to be queries through vertex PositionSignature(Vector3, float).
public static Dictionary<string, List<GLVertex>> BuildVertexPosDict(this IEnumerable<IGLFigure> figures, float tol)
Parameters
figures
IEnumerable<IGLFigure>Gl figures which retrieve vertexes.
tol
floatVertex position tolerance to group them.
Returns
- Dictionary<string, List<GLVertex>>
Dictionary gl vertex position signature to list of gl vertexes within that position.
Center(IGLFigure)
Mean of figure vertexes.
public static Vector3 Center(this IGLFigure figure)
Parameters
figure
IGLFigure
Returns
Describe(IEnumerable<GLFontChar>, string)
Debugging of GLFontChar to xlsx.
Used in GetFontChars(string, SKFont).
public static void Describe(this IEnumerable<GLFontChar> fontChars, string xlsxPathfilename)
Parameters
fontChars
IEnumerable<GLFontChar>xlsxPathfilename
string
DistinctPoints(IEnumerable<Line>, float)
public static IEnumerable<Vector3> DistinctPoints(this IEnumerable<Line> lines, float tol)
Parameters
lines
IEnumerable<Line>tol
float
Returns
DistinctPoints(IList<Line>, float)
From the given set of consecutive lines (from,to not required to be adjacent between) retrieve the sorted points of the line sequence without duplicates.
public static IEnumerable<Vector3> DistinctPoints(this IList<Line> lines, float tol)
Parameters
Returns
- IEnumerable<Vector3>
Sorted lines points.
EnsureDetached(IGLVertexManagerObject)
Throws an exception if this object isn't detached from any vertex managers.
public static void EnsureDetached(this IGLVertexManagerObject obj)
Parameters
EqualsTol(in Vector2, float, in Vector2?)
States if given vector2 equals (with tolerance) to the given one.
public static bool EqualsTol(this in Vector2 v, float tol, in Vector2? other)
Parameters
Returns
EqualsTol(in Vector3, float, in Vector3?)
States if given vector3 equals (with tolerance) to the given one.
public static bool EqualsTol(this in Vector3 v, float tol, in Vector3? other)
Parameters
Returns
EqualsTol(in Vector4, float, in Vector4?)
States if given vector4 equals (with tolerance) to the given one.
public static bool EqualsTol(this in Vector4 v, float tol, in Vector4? other)
Parameters
Returns
EqualsTol(float, float, float)
States if given number equals (with tolerance) to the given one.
public static bool EqualsTol(this float x, float tol, float y)
Parameters
Returns
FeasibleTriIntersectionTests<T>(IEnumerable<T>, double, IEnumerable<T>, double)
Find feasible triangle pairs that could intersect by evaluating the
SearchAThing.Sci.DiscreteSpace<T> over this set of triangles
against the given set of triangles.
Search will be done using GetItemsAt(Vector3D, double) method
within given margin parameter factor respect the triangle bbox.
public static IEnumerable<(T tri1, T tri2)> FeasibleTriIntersectionTests<T>(this IEnumerable<T> tris1, double tol, IEnumerable<T> tris2, double margin = 1.2) where T : IGLTriangle
Parameters
tris1
IEnumerable<T>This triangles.
tol
doubleIntersection test length comparision tolerance.
tris2
IEnumerable<T>Other triangles.
margin
doubleBbox factor (Default:1.2).
Returns
- IEnumerable<(T tri1, T tri2)>
Type Parameters
T
FlipX(in Matrix4x4)
Create a new world matrix copy of the given one but with x flipped ( then also the z ).
public static Matrix4x4 FlipX(this in Matrix4x4 m)
Parameters
m
Matrix4x4Input world matrix.
Returns
FlipY(in Matrix4x4)
Create a new world matrix copy of the given one but with y flipped ( then also the z ).
public static Matrix4x4 FlipY(this in Matrix4x4 m)
Parameters
m
Matrix4x4Input world matrix.
Returns
FlipZ(in Matrix4x4)
Create a new world matrix copy of the given one but with z flipped ( then also the x ).
public static Matrix4x4 FlipZ(this in Matrix4x4 m)
Parameters
m
Matrix4x4Input world matrix.
Returns
Fmt(in Matrix4x4, int, int)
Format to string given matrix.
public static string Fmt(this in Matrix4x4 m, int dec, int width = 10)
Parameters
m
Matrix4x4Input matrix.
dec
intDecimal places to show in formatted string.
width
intNr. of characters foreach component.
Returns
- string
String formatted representation of the matrix.
Fmt(in Vector3)
Invariant representation X Y Z
public static string Fmt(this in Vector3 v)
Parameters
v
Vector3
Returns
GL(GLPrimitiveType)
Retrieve corresponding Silk.NET gl type from netcore-opengl GLPrimitiveType.
public static PrimitiveType GL(this GLPrimitiveType type)
Parameters
type
GLPrimitiveType
Returns
- PrimitiveType
GetTriangles(Plate, Color?, Color?, Color?, Color?, bool)
Create 2 triangles from given plate.
Default normal of generated triangles will be in accord between them having:
- first triangle (P1, P2, P3)
- second triangle (P3, P4, P1)
public static IEnumerable<GLTriangle> GetTriangles(this Plate plate, Color? color1, Color? color2, Color? color3, Color? color4, bool setTextureST = false)
Parameters
plate
PlatePlate for which create 2 triangles.
color1
Color?(optional) color to apply to vertex1.
color2
Color?(optional) color to apply to vertex2.
color3
Color?(optional) color to apply to vertex3.
color4
Color?(optional) color to apply to vertex4.
setTextureST
boolIf true TextureST will be set in order to map texture on the plate.
Returns
- IEnumerable<GLTriangle>
Two triangles.
GetTriangles(Plate, in Color?, bool)
Create 2 triangles from given plate.
Default normal of generated triangles will be in accord between them having:
- first triangle (P1, P2, P3)
- second triangle (P3, P4, P1)
public static IEnumerable<GLTriangle> GetTriangles(this Plate plate, in Color? color = null, bool setTextureST = false)
Parameters
plate
PlatePlate for which create 2 triangles.
color
Color?Color to apply to created triangles.
setTextureST
boolIf true TextureST will be set in order to map texture on the plate.
Returns
- IEnumerable<GLTriangle>
Two triangles.
GreatThanOrEqualsTol(float, float, float)
States if given number great than or equals (with tolerance) to the given one.
public static bool GreatThanOrEqualsTol(this float x, float tol, float y)
Parameters
Returns
GreatThanTol(float, float, float)
States if given number great than (with tolerance) to the given one.
public static bool GreatThanTol(this float x, float tol, float y)
Parameters
Returns
Intersect(GLTriangle, float, GLTriangle, out bool)
Retrieve intersection segment if exists between given two triangles.
public static Line? Intersect(this GLTriangle tri1, float tol, GLTriangle tri2, out bool bboxSkipped)
Parameters
tri1
GLTriangleFirst triangle.
tol
floatLength comparision tolerance.
tri2
GLTriangleSecond triangle.
bboxSkipped
boolTrue if intersect test skipped due to non intersecting bboxes.
Returns
- Line
Intersection line between two triangles or null if no intersection exists.
Intersect(Line, float, GLFigureBase)
Intersect given raycast to given figure primitives.
Given [local] raycast will automatically backwarded to [object] raycast depending on the object matrix of given figure.
RayCastLocal(in Vector2)
public static IEnumerable<RayCastHitTest> Intersect(this Line lraycast, float tol, GLFigureBase figure)
Parameters
lraycast
LineRay cast [local].
tol
floatLength tolerance comparision ( used for point and line primitives match ).
figure
GLFigureBaseFigure to test for hit vs. given raycast.
Returns
- IEnumerable<RayCastHitTest>
List of hits, at most one foreach figure primitive.
Inverse(in Matrix4x4)
Compute the inverse of the given 4x4 matrix.
public static Matrix4x4 Inverse(this in Matrix4x4 m)
Parameters
m
Matrix4x4Input matrix.
Returns
- Matrix4x4
Inverse matrix.
IsAttached(IGLVertexManagerObject)
States if this object is currently attached to a gl vertex manager.
public static bool IsAttached(this IGLVertexManagerObject obj)
Parameters
Returns
IsParallel(in Vector3, float, in Vector3)
States if two vectors are parallel.
public static bool IsParallel(this in Vector3 v, float tol, in Vector3 other)
Parameters
v
Vector3This vector.
tol
floatLength tolerance (use SearchAThing.Sci.Constants.NormalizedLengthTolerance for normalized vectors).
other
Vector3Other vector.
Returns
- bool
True if two vectors are parallel.
LessThanOrEqualsTol(float, float, float)
States if given number less than or equals (with tolerance) to the given one.
public static bool LessThanOrEqualsTol(this float x, float tol, float y)
Parameters
Returns
LessThanTol(float, float, float)
States if given number less than (with tolerance) to the given one.
public static bool LessThanTol(this float x, float tol, float y)
Parameters
Returns
LineTo(in Vector3, in Vector3, in Color?)
Create a gl line primitive from given two points.
public static GLLine LineTo(this in Vector3 from, in Vector3 to, in Color? color = null)
Parameters
from
Vector3From position.
to
Vector3To position.
color
Color?(Optional) from, to line vertexes color.
Returns
LineV(in Vector3, in Vector3)
Create a line from this point with given extension vector.
public static Line LineV(this in Vector3 from, in Vector3 v)
Parameters
Returns
LineV(in Vector3, in Vector3, in Color?)
Create a gl line primitive from given position and vector extension.
public static GLLine LineV(this in Vector3 p, in Vector3 v, in Color? color = null)
Parameters
p
Vector3From position.
v
Vector3Extension vector.
color
Color?(Optional) from, to line vertexes color.
Returns
Lines(BBox, Color?)
Create wcs gl lines that represents the given bounding box.
public static IEnumerable<GLLine> Lines(this BBox bbox, Color? color = null)
Parameters
bbox
BBoxBounding box for which create gl lines.
color
Color?(optional) color to apply created gl lines.
Returns
- IEnumerable<GLLine>
GL lines.
LoadTexture(GLModel, string)
Load texture from given bitmap pathfilename.
public static GLTexture2D LoadTexture(this GLModel model, string pathfilename)
Parameters
model
GLModelGl model into which load the texture.
pathfilename
stringTexture bitmap pathfilename.
Returns
- GLTexture2D
Gl texture 2d object.
MRound(float, float)
Round given number using the multiple basis.
public static float MRound(this float value, float multiple)
Parameters
Returns
Magnitude(float)
Retrieve the magnitude of given number.
public static int Magnitude(this float value)
Parameters
value
float
Returns
MakeFigure(BBox, in Color?)
Create wcs lines figure that represents the given bounding box.
public static GLLineFigure MakeFigure(this BBox bbox, in Color? color)
Parameters
bbox
BBoxBounding box for which create line figures.
color
Color?(optional) color to apply created figure.
Returns
- GLLineFigure
Lines figure.
Max(in Vector3)
Retrieve the maxest component between x, y, z of given vector3.
public static float Max(this in Vector3 v)
Parameters
v
Vector3
Returns
Move(in Matrix4x4, in Vector3?)
Create a new world matrix copy of the given one but with origin moved of given delta.
public static Matrix4x4 Move(this in Matrix4x4 m, in Vector3? delta = null)
Parameters
Returns
- Matrix4x4
Origin moved world matrix.
Move(in Matrix4x4, float, float, float)
Create a new world matrix copy of the given one but with origin moved of given delta.
public static Matrix4x4 Move(this in Matrix4x4 m, float dx, float dy, float dz)
Parameters
m
Matrix4x4Input world matrix.
dx
floatDelta (x) to apply to the origin.
dy
floatDelta (y) to apply to the origin.
dz
floatDelta (z) to apply to the origin.
Returns
- Matrix4x4
Origin moved world matrix.
Move<T>(IEnumerable<T>, Vector3, bool)
Move given figures by the given delta.
public static IEnumerable<T> Move<T>(this IEnumerable<T> figures, Vector3 coord, bool relative = true) where T : IGLFigure
Parameters
figures
IEnumerable<T>Figures to move.
coord
Vector3Delta vector3 [object]
relative
boolIf true (default) sum the given delta elsewhere replace the object matrix translation.
Returns
- IEnumerable<T>
This figure reference.
Type Parameters
T
Remarks
- No vertex change, but only the object matrix associated to this figure.
- Object matrix will replaced with a single translation.
Move<T>(T, in Vector3, bool)
Move the figure by the given delta.
public static T Move<T>(this T figure, in Vector3 coord, bool relative = true) where T : IGLFigure
Parameters
figure
TFigure to move.
coord
Vector3Delta vector3 [object]
relative
boolIf true (default) sum the given delta elsewhere replace the object matrix translation.
Returns
- T
This figure reference.
Type Parameters
T
Remarks
- No vertex change, but only the object matrix associated to this figure.
- Object matrix will replaced with a single translation.
Move<T>(T, float, float, float, bool)
Move the figure by the given delta.
public static T Move<T>(this T figure, float dx, float dy, float dz, bool relative = true) where T : IGLFigure
Parameters
figure
TFigure to move.
dx
floatDelta (x) [object]
dy
floatDelta (y) [object]
dz
floatDelta (z) [object]
relative
boolIf true (default) sum the given delta elsewhere replace the object matrix translation.
Returns
- T
This figure reference.
Type Parameters
T
Remarks
- No vertex change, but only the object matrix associated to this figure.
- Object matrix will replaced with a single translation.
Normalized(in Vector3)
Normalize given vector.
public static Vector3 Normalized(this in Vector3 v)
Parameters
v
Vector3
Returns
OBBox(IEnumerable<GLFigureBase>)
Object space bbox of given figures vertexes.
public static BBox OBBox(this IEnumerable<GLFigureBase> figures)
Parameters
figures
IEnumerable<GLFigureBase>Gl figures to compute bbox.
Returns
- BBox
Figures bbox [object].
Origin(in Matrix4x4)
Extract the origin (m4[1..3]) from the given world matrix.
public static Vector3 Origin(this in Matrix4x4 m)
Parameters
Returns
PositionSignature(IGLVertex, float)
Retrieve vertex position signature within given tolerance.
public static string PositionSignature(this IGLVertex glVertex, float tol)
Parameters
Returns
PositionSignature(Vector3, float)
Retrieve vector3 position signature within given tolerance.
public static string PositionSignature(this Vector3 position, float tol)
Parameters
Returns
Project(in Vector3, in Matrix4x4)
Project this vector to given xy plane.
public static Vector3? Project(this in Vector3 v, in Matrix4x4 xyPlane)
Parameters
Returns
- Vector3?
Projected vector.
Project(in Vector3, in Vector3)
Project this vector to the other given.
References: https://en.wikipedia.org/wiki/Vector_projection
public static Vector3 Project(this in Vector3 v, in Vector3 other)
Parameters
Returns
- Vector3
Projection point if any on the other vector.
SaveTo(SKBitmap, string, SKEncodedImageFormat, int)
Helper method to save skia bitmap to output image file.
public static void SaveTo(this SKBitmap bitmap, string outputPathfilename, SKEncodedImageFormat format = SKEncodedImageFormat.Png, int quality = 80)
Parameters
bitmap
SKBitmapoutputPathfilename
stringformat
SKEncodedImageFormatquality
int
ScaleAbout(in Vector3, in Vector3, float)
Scale given vector respect given origin by the given scale factor.
public static Vector3 ScaleAbout(this in Vector3 v, in Vector3 origin, float factor)
Parameters
Returns
- Vector3
Scaled vector.
Segments(IGLTriangle)
Retrieve gl triangle segments {v1,v2},{v2,v3},{v3,v1} [object].
public static IEnumerable<Line> Segments(this IGLTriangle tri)
Parameters
tri
IGLTriangle
Returns
SetAlphaF(in Color, float)
Set alpha channel
Alpha=1 (full opaque).
Alpha=0 (full transparent).
public static Color SetAlphaF(this in Color color, float alpha)
Parameters
Returns
SetAlpha<T>(T, float?)
Set figure alpha ( 0:full transparent, 1:full opaque ).
Alpha
public static T SetAlpha<T>(this T fig, float? alpha) where T : IGLFigure
Parameters
fig
Talpha
float?
Returns
- T
Type Parameters
T
SetColor(IGLVertex, in Color)
Change the color of the vertex.
public static IGLVertex SetColor(this IGLVertex vertex, in Color color)
Parameters
Returns
SetColor(IGLVertex, in Vector4)
Change the color of the vertex.
public static IGLVertex SetColor(this IGLVertex vertex, in Vector4 rgbaColor)
Parameters
vertex
IGLVertexVertex which change the color.
rgbaColor
Vector4Color to apply encoded in vector4 (range 0..1) as (red, green, blue, alpha).
Alpha=1 (full opaque).
Alpha=0 (full transparent).
Returns
SetColor<T>(IEnumerable<T>, in Color)
Set the color primitives vertexes.
public static IEnumerable<T> SetColor<T>(this IEnumerable<T> primitives, in Color color) where T : GLPrimitiveBase
Parameters
primitives
IEnumerable<T>Gl primitives.
color
ColorColor to set on primitives vertexes.
Returns
- IEnumerable<T>
Calling enumerable.
Type Parameters
T
SetColor<T>(IEnumerable<T>, in Vector4)
Set the color primitives vertexes.
public static IEnumerable<T> SetColor<T>(this IEnumerable<T> primitives, in Vector4 rgbaColor) where T : GLPrimitiveBase
Parameters
primitives
IEnumerable<T>Gl primitives.
rgbaColor
Vector4Color to set on primitives vertexes.
Returns
- IEnumerable<T>
Calling enumerable.
Type Parameters
T
SetColor<T>(T, in Color)
Set color on primitives vertexes of this figure.
public static T SetColor<T>(this T fig, in Color color) where T : IGLFigure
Parameters
fig
TFigure on which operate.
color
ColorColor to set on vertexes.
Returns
- T
This figure.
Type Parameters
T
SetColor<T>(T, in Vector4)
Set color on primitives vertexes of this figure.
public static T SetColor<T>(this T fig, in Vector4 rgbaColor) where T : IGLFigure
Parameters
fig
TFigure on which operate.
rgbaColor
Vector4Color to set on vertexes.
Returns
- T
This figure.
Type Parameters
T
SetOrder<T>(T, int)
Change the figure order.
public static T SetOrder<T>(this T fig, int order) where T : IGLFigure
Parameters
fig
TFigure on which operate.
order
intOrder to set.
Returns
- T
This figure.
Type Parameters
T
- See Also
SetOrigin(in Matrix4x4, in Vector3)
Create a new world matrix copy of the given one but with origin set to given one.
public static Matrix4x4 SetOrigin(this in Matrix4x4 m, in Vector3 origin)
Parameters
Returns
- Matrix4x4
Origin repositioned world matrix.
SetScreenMode<T>(IEnumerable<T>, bool)
Sets ScreenCoordMode on given figures.
public static IEnumerable<T> SetScreenMode<T>(this IEnumerable<T> figures, bool screenCoordMode) where T : IGLFigure
Parameters
figures
IEnumerable<T>screenCoordMode
bool
Returns
- IEnumerable<T>
Type Parameters
T
SetScreenMode<T>(T, bool)
Sets ScreenCoordMode on given figure.
public static T SetScreenMode<T>(this T figure, bool screenCoordMode) where T : IGLFigure
Parameters
figure
TscreenCoordMode
bool
Returns
- T
Type Parameters
T
ShortString(CameraViewType)
public static string ShortString(this CameraViewType cvt)
Parameters
cvt
CameraViewType
Returns
ToColor(HSV)
Retrieve system drawing color from given ColorHelper HSV color.
public static Color ToColor(this HSV hsv)
Parameters
hsv
HSV
Returns
ToColor(RGB)
Retrieve system drawing color from given ColorHelper RGB color.
public static Color ToColor(this RGB rgb)
Parameters
rgb
RGB
Returns
ToColor(in Vector4)
Convert given vector4 (red, green, blue, alpha) color to Color.
public static Color ToColor(this in Vector4 rgbaColor)
Parameters
rgbaColor
Vector4Color encoded in vector4 (range 0..1) as (red, green, blue, alpha).
Alpha=1 (full opaque).
Alpha=0 (full transparent).
Returns
ToDxfColor(Color)
Convert system drawing color to dxf color.
public static AciColor ToDxfColor(this Color color)
Parameters
color
Color
Returns
- AciColor
ToDxfLine(IGLLine)
Create dxf line from given gl line.
public static Line ToDxfLine(this IGLLine line)
Parameters
line
IGLLine
Returns
- Line
ToDxfPoint(IGLPoint)
Create dxf point from given gl point.
public static Point ToDxfPoint(this IGLPoint point)
Parameters
point
IGLPoint
Returns
- Point
ToDxfVector3(IGLVertex)
Convert given gl vertex to dxf vector3.
public static Vector3 ToDxfVector3(this IGLVertex vertex)
Parameters
vertex
IGLVertex
Returns
- Vector3
ToDxfVector3(in Vector3)
Convert given system numerics vector3 to dxf vector3
public static Vector3 ToDxfVector3(this in Vector3 v)
Parameters
v
Vector3
Returns
- Vector3
ToFigure(IEnumerable<GLPoint>)
Create point figure from given point set.
public static GLPointFigure ToFigure(this IEnumerable<GLPoint> points)
Parameters
points
IEnumerable<GLPoint>
Returns
ToFigure(IEnumerable<GLTriangle>)
Create a gl figure from given gl triangles.
public static GLTriangleFigure ToFigure(this IEnumerable<GLTriangle> triangles)
Parameters
triangles
IEnumerable<GLTriangle>
Returns
ToFigure(IEnumerable<Vector3>)
Create point figure from given point set.
public static GLPointFigure ToFigure(this IEnumerable<Vector3> points)
Parameters
points
IEnumerable<Vector3>
Returns
ToFloat(double)
Convert given double to float ensuring not exceed the float range.
public static float ToFloat(this double d)
Parameters
d
doubleDouble which convert to float.
Returns
- float
Float of the given double.
ToGLLine(Line, in Color, in Color)
Create a gl line primitive from given line geometry applying given from, to colors.
public static GLLine ToGLLine(this Line line, in Color colorFrom, in Color colorTo)
Parameters
line
LineLine geometry.
colorFrom
ColorColor to apply the from vertex.
colorTo
ColorColor to apply the to vertex.
Returns
- GLLine
GL line primitive.
ToGLLine(Line, in Color?)
Create a gl line primitive from given line geometry.
public static GLLine ToGLLine(this Line line, in Color? color)
Parameters
Returns
- GLLine
GL line primitive.
ToHSV(Color)
Retrieve ColorHelper HSV color from given system drawing color.
public static HSV ToHSV(this Color color)
Parameters
color
Color
Returns
- HSV
ToLine(Line3D)
Convert given sci line to line.
public static Line ToLine(this Line3D line)
Parameters
line
Line3D
Returns
ToLine3D(Line)
Convert given line to sci line.
public static Line3D ToLine3D(this Line line)
Parameters
line
Line
Returns
- Line3D
ToRGB(HSV)
Retrieve ColorHelper RGB color from given ColorHelper HSV color.
public static RGB ToRGB(this HSV hsv)
Parameters
hsv
HSV
Returns
- RGB
ToRGB(Color)
Retrieve ColorHelper RGB color from given system drawing color.
public static RGB ToRGB(this Color color)
Parameters
color
Color
Returns
- RGB
ToString(in Vector3, int)
public static string ToString(this in Vector3 v, int digits = 3)
Parameters
Returns
ToString(in Vector3, float)
public static string ToString(this in Vector3 v, float tol)
Parameters
Returns
ToString(float, int)
public static string ToString(this float d, int significantDigits)
Parameters
Returns
ToTriangle3D(GLTriangle)
Create sci Triangle3D from given gl triangle.
public static Triangle3D ToTriangle3D(this GLTriangle tri)
Parameters
tri
GLTriangle
Returns
- Triangle3D
ToUCS(in Vector3, in Matrix4x4, bool)
Transformation given one from wcs toward the given destination coordinate system.
public static Vector3 ToUCS(this in Vector3 v, in Matrix4x4 cs, bool evalCSOrigin = true)
Parameters
v
Vector3Vector to transform.
cs
Matrix4x4Destination coordinate system.
evalCSOrigin
boolIf true the origin of the coordinate system will be evaluated during transformation ( default: true ).
Returns
ToVector2(in Size)
Convert given screen size (width, height) to a vector2 (x, y).
public static Vector2 ToVector2(this in Size size)
Parameters
size
Size
Returns
ToVector3(in Color)
Convert given Color to vector3 (red, green, blue) discarding alpha information.
public static Vector3 ToVector3(this in Color color)
Parameters
color
ColorColor to convert.
Returns
ToVector4(in Color, float?)
Convert given Color to vector4 (red, green, blue, alpha).
public static Vector4 ToVector4(this in Color color, float? alpha = null)
Parameters
color
ColorColor to convert.
alpha
float?(optional) Alpha override.
Alpha=1 (full opaque).
Alpha=0 (full transparent).
If not specified given color alpha will taken.
Returns
ToWCS(in Vector3, in Matrix4x4, bool)
Transformation given one from the coordinate system given toward the wcs.
public static Vector3 ToWCS(this in Vector3 v, in Matrix4x4 cs, bool evalCSOrigin = true)
Parameters
v
Vector3Vector to transform.
cs
Matrix4x4Source coordinate system.
evalCSOrigin
boolIf true the origin of the coordinate system will be evaluated during transofmration ( default: true ).
Returns
Transform(Line, in Matrix4x4)
Create a new line with from, to transformed by the given transformation matrix.
public static Line Transform(this Line line, in Matrix4x4 m)
Parameters
Returns
- Line
Transformed line.
Transform(in Vector3, in Matrix4x4)
Transform given one within given transformation matrix.
public static Vector3 Transform(this in Vector3 v, in Matrix4x4 transform)
Parameters
Returns
- Vector3
Transformed vector.
Vertexes(IGLFigure)
Vertexes belonging this figure [object].
public static IEnumerable<GLVertex> Vertexes(this IGLFigure figure)
Parameters
figure
IGLFigure