AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
SpatialUnderstandingDllShapes.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 using UnityEngine;
5 using System.Collections;
6 using System.Runtime.InteropServices;
7 using System;
8 using System.Collections.Generic;
9 
10 namespace HoloToolkit.Unity
11 {
23  public static class SpatialUnderstandingDllShapes
24  {
28  [StructLayout(LayoutKind.Sequential, Pack = 1)]
29  public struct ShapeResult
30  {
31  public Vector3 position;
32  public Vector3 halfDims;
33  };
34 
39  {
40  SurfaceNotPartOfShape,
41 
42  SurfaceHeight_Min,
43  SurfaceHeight_Max,
44  SurfaceHeight_Between,
45  SurfaceHeight_Is,
46 
47  SurfaceCount_Min,
48  SurfaceCount_Max,
49  SurfaceCount_Between,
50  SurfaceCount_Is,
51 
52  SurfaceArea_Min,
53  SurfaceArea_Max,
54  SurfaceArea_Between,
55  SurfaceArea_Is,
56 
57  IsRectangle,
58  RectangleSize_Min,
59  RectangleSize_Max,
60  RectangleSize_Between,
61  RectangleSize_Is,
62 
63  RectangleLength_Min,
64  RectangleLength_Max,
65  RectangleLength_Between,
66  RectangleLength_Is,
67 
68  RectangleWidth_Min,
69  RectangleWidth_Max,
70  RectangleWidth_Between,
71  RectangleWidth_Is,
72 
73  IsSquare,
74  SquareSize_Min,
75  SquareSize_Max,
76  SquareSize_Between,
77  SquareSize_Is,
78 
79  IsCircle,
80  CircleRadius_Min,
81  CircleRadius_Max,
82  CircleRadius_Between,
83  CircleRadius_Is,
84  };
85 
93  [StructLayout(LayoutKind.Sequential, Pack = 1)]
95  {
101  {
103  constraint.Type = ShapeComponentConstraintType.SurfaceNotPartOfShape;
104  constraint.Param_Str_0 = SpatialUnderstanding.Instance.UnderstandingDLL.PinString(shapeName);
105  return constraint;
106  }
107 
113  public static ShapeComponentConstraint Create_SurfaceHeight_Min(float minHeight)
114  {
116  constraint.Type = ShapeComponentConstraintType.SurfaceHeight_Min;
117  constraint.Param_Float_0 = minHeight;
118  return constraint;
119  }
120 
126  public static ShapeComponentConstraint Create_SurfaceHeight_Max(float maxHeight)
127  {
129  constraint.Type = ShapeComponentConstraintType.SurfaceHeight_Max;
130  constraint.Param_Float_0 = maxHeight;
131  return constraint;
132  }
133 
140  public static ShapeComponentConstraint Create_SurfaceHeight_Between(float minHeight, float maxHeight)
141  {
143  constraint.Type = ShapeComponentConstraintType.SurfaceHeight_Between;
144  constraint.Param_Float_0 = minHeight;
145  constraint.Param_Float_1 = maxHeight;
146  return constraint;
147  }
148 
155  {
157  constraint.Type = ShapeComponentConstraintType.SurfaceHeight_Is;
158  constraint.Param_Float_0 = height;
159  return constraint;
160  }
161 
168  {
170  constraint.Type = ShapeComponentConstraintType.SurfaceCount_Min;
171  constraint.Param_Int_0 = minCount;
172  return constraint;
173  }
174 
181  {
183  constraint.Type = ShapeComponentConstraintType.SurfaceCount_Max;
184  constraint.Param_Int_0 = maxCount;
185  return constraint;
186  }
187 
195  public static ShapeComponentConstraint Create_SurfaceCount_Between(int minCount, int maxCount)
196  {
198  constraint.Type = ShapeComponentConstraintType.SurfaceCount_Between;
199  constraint.Param_Int_0 = minCount;
200  constraint.Param_Int_1 = maxCount;
201  return constraint;
202  }
203 
211  {
213  constraint.Type = ShapeComponentConstraintType.SurfaceCount_Is;
214  constraint.Param_Int_0 = count;
215  return constraint;
216  }
217 
224  {
226  constraint.Type = ShapeComponentConstraintType.SurfaceArea_Min;
227  constraint.Param_Float_0 = minArea;
228  return constraint;
229  }
230 
237  {
239  constraint.Type = ShapeComponentConstraintType.SurfaceArea_Max;
240  constraint.Param_Float_0 = maxArea;
241  return constraint;
242  }
243 
251  public static ShapeComponentConstraint Create_SurfaceArea_Between(float minArea, float maxArea)
252  {
254  constraint.Type = ShapeComponentConstraintType.SurfaceArea_Between;
255  constraint.Param_Float_0 = minArea;
256  constraint.Param_Float_1 = maxArea;
257  return constraint;
258  }
259 
266  {
268  constraint.Type = ShapeComponentConstraintType.SurfaceArea_Is;
269  constraint.Param_Float_0 = area;
270  return constraint;
271  }
272 
281  public static ShapeComponentConstraint Create_IsRectangle(float similarityMin = 0.5f)
282  {
284  constraint.Type = ShapeComponentConstraintType.IsRectangle;
285  constraint.Param_Float_0 = similarityMin;
286  return constraint;
287  }
288 
296  public static ShapeComponentConstraint Create_RectangleSize_Min(float minLength, float minWidth)
297  {
299  constraint.Type = ShapeComponentConstraintType.RectangleSize_Min;
300  constraint.Param_Float_0 = minLength;
301  constraint.Param_Float_1 = minWidth;
302  return constraint;
303  }
304 
312  public static ShapeComponentConstraint Create_RectangleSize_Max(float maxLength, float maxWidth)
313  {
315  constraint.Type = ShapeComponentConstraintType.RectangleSize_Max;
316  constraint.Param_Float_0 = maxLength;
317  constraint.Param_Float_1 = maxWidth;
318  return constraint;
319  }
320 
331  public static ShapeComponentConstraint Create_RectangleSize_Between(float minLength, float minWidth, float maxLength, float maxWidth)
332  {
334  constraint.Type = ShapeComponentConstraintType.RectangleSize_Between;
335  constraint.Param_Float_0 = minLength;
336  constraint.Param_Float_1 = minWidth;
337  constraint.Param_Float_2 = maxLength;
338  constraint.Param_Float_3 = maxWidth;
339  return constraint;
340  }
341 
349  public static ShapeComponentConstraint Create_RectangleSize_Is(float length, float width)
350  {
352  constraint.Type = ShapeComponentConstraintType.RectangleSize_Is;
353  constraint.Param_Float_0 = length;
354  constraint.Param_Float_1 = width;
355  return constraint;
356  }
357 
365  {
367  constraint.Type = ShapeComponentConstraintType.RectangleLength_Min;
368  constraint.Param_Float_0 = minLength;
369  return constraint;
370  }
371 
379  {
381  constraint.Type = ShapeComponentConstraintType.RectangleLength_Max;
382  constraint.Param_Float_0 = maxLength;
383  return constraint;
384  }
385 
393  public static ShapeComponentConstraint Create_RectangleLength_Between(float minLength, float maxLength)
394  {
396  constraint.Type = ShapeComponentConstraintType.RectangleLength_Between;
397  constraint.Param_Float_0 = minLength;
398  constraint.Param_Float_1 = maxLength;
399  return constraint;
400  }
401 
409  {
411  constraint.Type = ShapeComponentConstraintType.RectangleLength_Is;
412  constraint.Param_Float_0 = length;
413  return constraint;
414  }
415 
423  {
425  constraint.Type = ShapeComponentConstraintType.RectangleWidth_Min;
426  constraint.Param_Float_0 = minWidth;
427  return constraint;
428  }
429 
437  {
439  constraint.Type = ShapeComponentConstraintType.RectangleWidth_Max;
440  constraint.Param_Float_0 = maxWidth;
441  return constraint;
442  }
450  public static ShapeComponentConstraint Create_RectangleWidth_Between(float minWidth, float maxWidth)
451  {
453  constraint.Type = ShapeComponentConstraintType.RectangleWidth_Between;
454  constraint.Param_Float_0 = minWidth;
455  constraint.Param_Float_1 = maxWidth;
456  return constraint;
457  }
458 
466  {
468  constraint.Type = ShapeComponentConstraintType.RectangleWidth_Is;
469  constraint.Param_Float_0 = width;
470  return constraint;
471  }
472 
481  public static ShapeComponentConstraint Create_IsSquare(float similarityMin = 0.5f)
482  {
484  constraint.Type = ShapeComponentConstraintType.IsSquare;
485  constraint.Param_Float_0 = similarityMin;
486  return constraint;
487  }
488 
494  public static ShapeComponentConstraint Create_SquareSize_Min(float minSize)
495  {
497  constraint.Type = ShapeComponentConstraintType.SquareSize_Min;
498  constraint.Param_Float_0 = minSize;
499  return constraint;
500  }
501 
507  public static ShapeComponentConstraint Create_SquareSize_Max(float maxSize)
508  {
510  constraint.Type = ShapeComponentConstraintType.SquareSize_Max;
511  constraint.Param_Float_0 = maxSize;
512  return constraint;
513  }
514 
522  public static ShapeComponentConstraint Create_SquareSize_Between(float minSize, float maxSize)
523  {
525  constraint.Type = ShapeComponentConstraintType.SquareSize_Between;
526  constraint.Param_Float_0 = minSize;
527  constraint.Param_Float_1 = maxSize;
528  return constraint;
529  }
530 
537  {
539  constraint.Type = ShapeComponentConstraintType.SquareSize_Is;
540  constraint.Param_Float_0 = size;
541  return constraint;
542  }
543 
552  public static ShapeComponentConstraint Create_IsCircle(float similarityMin = 0.5f)
553  {
555  constraint.Type = ShapeComponentConstraintType.IsCircle;
556  constraint.Param_Float_0 = similarityMin;
557  return constraint;
558  }
559 
566  public static ShapeComponentConstraint Create_CircleRadius_Min(float minRadius)
567  {
569  constraint.Type = ShapeComponentConstraintType.CircleRadius_Min;
570  constraint.Param_Float_0 = minRadius;
571  return constraint;
572  }
573 
580  public static ShapeComponentConstraint Create_CircleRadius_Max(float maxRadius)
581  {
583  constraint.Type = ShapeComponentConstraintType.CircleRadius_Max;
584  constraint.Param_Float_0 = maxRadius;
585  return constraint;
586  }
587 
595  public static ShapeComponentConstraint Create_CircleRadius_Between(float minRadius, float maxRadius)
596  {
598  constraint.Type = ShapeComponentConstraintType.CircleRadius_Between;
599  constraint.Param_Float_0 = minRadius;
600  constraint.Param_Float_1 = maxRadius;
601  return constraint;
602  }
603 
611  {
613  constraint.Type = ShapeComponentConstraintType.CircleRadius_Is;
614  constraint.Param_Float_0 = radius;
615  return constraint;
616  }
617 
619  public float Param_Float_0;
620  public float Param_Float_1;
621  public float Param_Float_2;
622  public float Param_Float_3;
623  public int Param_Int_0;
624  public int Param_Int_1;
625  public IntPtr Param_Str_0;
626  };
627 
631  [StructLayout(LayoutKind.Sequential, Pack = 1)]
632  public struct ShapeComponent
633  {
634  public ShapeComponent(List<ShapeComponentConstraint> componentConstraints)
635  {
636  ConstraintCount = componentConstraints.Count;
637  Constraints = SpatialUnderstanding.Instance.UnderstandingDLL.PinObject(componentConstraints.ToArray());
638  }
639 
640  public int ConstraintCount;
641  public IntPtr Constraints; // ShapeComponentConstraint
642  };
643 
649  {
650  NoOtherSurface,
651  AwayFromWalls,
652 
653  RectanglesParallel,
654  RectanglesPerpendicular,
655  RectanglesAligned,
656  RectanglesSameLength,
657 
658  AtFrontOf,
659  AtBackOf,
660  AtLeftOf,
661  AtRightOf,
662  };
663 
668  [StructLayout(LayoutKind.Sequential, Pack = 1)]
669  public struct ShapeConstraint
670  {
676  {
677  ShapeConstraint constraint = new ShapeConstraint();
678  constraint.Type = ShapeConstraintType.NoOtherSurface;
679  return constraint;
680  }
681 
687  {
688  ShapeConstraint constraint = new ShapeConstraint();
689  constraint.Type = ShapeConstraintType.AwayFromWalls;
690  return constraint;
691  }
692 
700  public static ShapeConstraint Create_RectanglesParallel(int componentIndexA, int componentIndexB)
701  {
702  ShapeConstraint constraint = new ShapeConstraint();
703  constraint.Type = ShapeConstraintType.RectanglesParallel;
704  constraint.Param_Int_0 = componentIndexA;
705  constraint.Param_Int_1 = componentIndexB;
706  return constraint;
707  }
708 
716  public static ShapeConstraint Create_RectanglesPerpendicular(int componentIndexA, int componentIndexB)
717  {
718  ShapeConstraint constraint = new ShapeConstraint();
719  constraint.Type = ShapeConstraintType.RectanglesPerpendicular;
720  constraint.Param_Int_0 = componentIndexA;
721  constraint.Param_Int_1 = componentIndexB;
722  return constraint;
723  }
724 
734  public static ShapeConstraint Create_RectanglesAligned(int componentIndexA, int componentIndexB, float maxDifference = 0.1f)
735  {
736  ShapeConstraint constraint = new ShapeConstraint();
737  constraint.Type = ShapeConstraintType.RectanglesAligned;
738  constraint.Param_Int_0 = componentIndexA;
739  constraint.Param_Int_1 = componentIndexB;
740  constraint.Param_Float_0 = maxDifference;
741  return constraint;
742  }
743 
754  public static ShapeConstraint Create_RectanglesSameLength(int componentIndexA, int componentIndexB, float similarityMin = 0.8f)
755  {
756  ShapeConstraint constraint = new ShapeConstraint();
757  constraint.Type = ShapeConstraintType.RectanglesSameLength;
758  constraint.Param_Int_0 = componentIndexA;
759  constraint.Param_Int_1 = componentIndexB;
760  constraint.Param_Float_0 = similarityMin;
761  return constraint;
762  }
763 
770  public static ShapeConstraint Create_AtFrontOf(int componentIndexA, int componentIndexB)
771  {
772  ShapeConstraint constraint = new ShapeConstraint();
773  constraint.Type = ShapeConstraintType.AtFrontOf;
774  constraint.Param_Int_0 = componentIndexA;
775  constraint.Param_Int_1 = componentIndexB;
776  return constraint;
777  }
778 
785  public static ShapeConstraint Create_AtBackOf(int componentIndexA, int componentIndexB)
786  {
787  ShapeConstraint constraint = new ShapeConstraint();
788  constraint.Type = ShapeConstraintType.AtBackOf;
789  constraint.Param_Int_0 = componentIndexA;
790  constraint.Param_Int_1 = componentIndexB;
791  return constraint;
792  }
793 
800  public static ShapeConstraint Create_AtLeftOf(int componentIndexA, int componentIndexB)
801  {
802  ShapeConstraint constraint = new ShapeConstraint();
803  constraint.Type = ShapeConstraintType.AtLeftOf;
804  constraint.Param_Int_0 = componentIndexA;
805  constraint.Param_Int_1 = componentIndexB;
806  return constraint;
807  }
808 
815  public static ShapeConstraint Create_AtRightOf(int componentIndexA, int componentIndexB)
816  {
817  ShapeConstraint constraint = new ShapeConstraint();
818  constraint.Type = ShapeConstraintType.AtRightOf;
819  constraint.Param_Int_0 = componentIndexA;
820  constraint.Param_Int_1 = componentIndexB;
821  return constraint;
822  }
823 
825  public float Param_Float_0;
826  public int Param_Int_0;
827  public int Param_Int_1;
828  };
829 
830  // Functions
840  // Queries (shapes)
841  [DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
842  public static extern int QueryShape_FindPositionsOnShape(
843  [In, MarshalAs(UnmanagedType.LPStr)] string shapeName, // char*
844  [In] float minRadius,
845  [In] int shapeCount, // Pass in the space allocated in shapeData
846  [In, Out] IntPtr shapeData); // ShapeResult
847 
856  [DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
857  public static extern int QueryShape_FindShapeHalfDims(
858  [In, MarshalAs(UnmanagedType.LPStr)] string shapeName, // char*
859  [In] int shapeCount, // Pass in the space allocated in shapeData
860  [In, Out] IntPtr shapeData); // ShapeResult
861 
873  [DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
874  public static extern int AddShape(
875  [In, MarshalAs(UnmanagedType.LPStr)] string shapeName,
876  [In] int componentCount,
877  [In] IntPtr components, // ShapeComponent
878  [In] int shapeConstraints,
879  [In] IntPtr constraints); // ShapeConstraint
880 
885  [DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
886  public static extern void ActivateShapeAnalysis();
887 
891  [DllImport("SpatialUnderstanding", CallingConvention = CallingConvention.Cdecl)]
892  public static extern void RemoveAllShapes();
893  }
894 }
static ShapeComponentConstraint Create_RectangleLength_Is(float length)
Constructs a constraint requiring a specific surface length. Length is the longer of the two bounding...
static ShapeComponentConstraint Create_CircleRadius_Between(float minRadius, float maxRadius)
Constructs a constraint requiring the circle shaped component to have a radius between the given rang...
A shape component constraint. This includes its type enum and its type specific parameters.
static ShapeConstraint Create_AtRightOf(int componentIndexA, int componentIndexB)
Constructs a constraint requiring component B to be immediately to the right of component A...
ShapeComponentConstraintType
Types of shape component constraints
static ShapeComponentConstraint Create_CircleRadius_Min(float minRadius)
Constructs a constraint requiring the circle shaped component to have a minimum radius ...
static ShapeComponentConstraint Create_SquareSize_Between(float minSize, float maxSize)
Constructs a constraint requiring the component to have a surface area between the given range ...
static ShapeComponentConstraint Create_SurfaceCount_Is(int count)
Constructs a constraint requiring the component to be a composed of a number of discrete flat surface...
static ShapeComponentConstraint Create_SquareSize_Min(float minSize)
Constructs a constraint requiring the component to have a minimum area
static ShapeComponentConstraint Create_SurfaceHeight_Min(float minHeight)
Constructs a constraint requiring the component to be a minimum height above the floor ...
ShapeConstraintType
Lists the types of shape constraints. Each defines a requirement between shape components.
static ShapeComponentConstraint Create_RectangleWidth_Between(float minWidth, float maxWidth)
Constructs a constraint requiring the surface width to be between the given range. Width is the shorter of the two bounding edges.
static ShapeConstraint Create_RectanglesAligned(int componentIndexA, int componentIndexB, float maxDifference=0.1f)
Constructs a constraint requiring the components shapes to be either aligned with parallel or paralle...
static ShapeComponentConstraint Create_SurfaceHeight_Between(float minHeight, float maxHeight)
Constructs a constraint requiring the component to be within a height range above the floor ...
A shape component definition. Contains a list of component constraints.
static ShapeConstraint Create_AtBackOf(int componentIndexA, int componentIndexB)
Constructs a constraint requiring component B to be immediately in back of component A...
A shape constraint definition. Composed of a type and type specific parameters
static ShapeComponentConstraint Create_SquareSize_Is(float size)
Constructs a constraint requiring the component to have a specific surface area
static ShapeComponentConstraint Create_RectangleWidth_Min(float minWidth)
Constructs a constraint requiring a minimum width. Width is the shorter of the two bounding edges...
static ShapeComponentConstraint Create_IsRectangle(float similarityMin=0.5f)
Constructs a constraint requiring the component to shaped like a rectangle.
static ShapeConstraint Create_AtLeftOf(int componentIndexA, int componentIndexB)
Constructs a constraint requiring component B to be immediately to the left of component A...
static ShapeComponentConstraint Create_SurfaceCount_Between(int minCount, int maxCount)
Constructs a constraint requiring the component to be a composed of a number of discrete flat surface...
static ShapeConstraint Create_AtFrontOf(int componentIndexA, int componentIndexB)
Constructs a constraint requiring component B to be immediately in front of component A...
ShapeComponent(List< ShapeComponentConstraint > componentConstraints)
static ShapeConstraint Create_RectanglesPerpendicular(int componentIndexA, int componentIndexB)
Constructs a constraint requiring the components shapes longer edges to have perpendicular alignment...
static ShapeComponentConstraint Create_SurfaceCount_Max(int maxCount)
Constructs a constraint requiring the component to be a maximum number of discrete flat surfaces ...
static ShapeComponentConstraint Create_RectangleSize_Between(float minLength, float minWidth, float maxLength, float maxWidth)
Constructs a constraint requiring a the length and width of the surface rectangle to be within a spec...
static ShapeComponentConstraint Create_SurfaceArea_Is(float area)
Constructs a constraint requiring the component to contain a specific surface area ...
static ShapeConstraint Create_AwayFromWalls()
Constructs a constraint requiring the shape to be away from all walls
static T Instance
Returns the Singleton instance of the classes type. If no instance is found, then we search for an in...
Definition: Singleton.cs:26
static ShapeComponentConstraint Create_SurfaceArea_Min(float minArea)
Constructs a constraint requiring the component to contain a minimum surface area ...
static ShapeComponentConstraint Create_CircleRadius_Max(float maxRadius)
Constructs a constraint requiring the circle shaped component to have a maximum radius ...
static ShapeComponentConstraint Create_CircleRadius_Is(float radius)
Constructs a constraint requiring the circle shaped component to have a specific radius ...
static ShapeComponentConstraint Create_RectangleSize_Max(float maxLength, float maxWidth)
Constructs a constraint requiring a maximum length and width of the surface rectangle. Length is the longer of the two bounding edges and width the shorter edge.
Encapsulates the shape detection queries of the understanding DLL. Shapes are defined by the user wit...
static ShapeComponentConstraint Create_RectangleSize_Is(float length, float width)
Constructs a constraint requiring a specified length and width. Length is the longer of the two bound...
static ShapeComponentConstraint Create_SurfaceHeight_Max(float maxHeight)
Constructs a constraint requiring the component to be a maximum height above the floor ...
static ShapeComponentConstraint Create_SurfaceArea_Between(float minArea, float maxArea)
Constructs a constraint requiring the component to contain a surface area between the range specified...
static ShapeComponentConstraint Create_RectangleWidth_Is(float width)
Constructs a constraint requiring a specific surface width. Width is the shorter of the two bounding ...
static ShapeComponentConstraint Create_IsCircle(float similarityMin=0.5f)
Constructs a constraint requiring the component to be shaped like a circle
static ShapeConstraint Create_RectanglesParallel(int componentIndexA, int componentIndexB)
Constructs a constraint requiring the components shapes longer edges to have parallel alignment...
static ShapeComponentConstraint Create_SurfaceArea_Max(float maxArea)
Constructs a constraint requiring the component to contain a maximum surface area ...
The SpatialUnderstanding class controls the state and flow of the scanning process used in the unders...
static ShapeComponentConstraint Create_SurfaceNotPartOfShape(string shapeName)
Constructs a constraint requiring the component to not be a part of a specified shape ...
static ShapeComponentConstraint Create_RectangleSize_Min(float minLength, float minWidth)
Constructs a constraint requiring a minimum length and width of the surface rectangle. Length is the longer of the two bounding edges and width the shorter edge.
static ShapeComponentConstraint Create_RectangleLength_Max(float maxLength)
Constructs a constraint requiring a maximum length. Length is the longer of the two bounding edges...
static ShapeConstraint Create_RectanglesSameLength(int componentIndexA, int componentIndexB, float similarityMin=0.8f)
Constructs a constraint requiring the components shapes longest edges to have the same length...
static ShapeComponentConstraint Create_RectangleWidth_Max(float maxWidth)
Constructs a constraint requiring a maximum width. Width is the shorter of the two bounding edges...
static ShapeComponentConstraint Create_RectangleLength_Min(float minLength)
Constructs a constraint requiring a minimum length. Length is the longer of the two bounding edges...
static ShapeComponentConstraint Create_SurfaceHeight_Is(float height)
Constructs a constraint requiring the component to be a specific height above the floor ...
static ShapeComponentConstraint Create_SurfaceCount_Min(int minCount)
Constructs a constraint requiring the component to be a minimum number of discrete flat surfaces ...
static ShapeComponentConstraint Create_RectangleLength_Between(float minLength, float maxLength)
Constructs a constraint requiring the surface length to be between the given range. Length is the longer of the two bounding edges.
static ShapeComponentConstraint Create_IsSquare(float similarityMin=0.5f)
Constructs a constraint requiring the component to be shaped like a square
static ShapeComponentConstraint Create_SquareSize_Max(float maxSize)
Constructs a constraint requiring the component to have a maximum area
static ShapeConstraint Create_NoOtherSurface()
Constructs a constraint required no other surfaces be included in this shape