]> OCCT Git - occt.git/commitdiff
0028850: Visualization - Length dimension along Horizontal/Vertical axes
authornds <nds@opencascade.com>
Mon, 3 Jul 2017 15:51:28 +0000 (18:51 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 28 Jul 2017 12:34:51 +0000 (15:34 +0300)
AIS_LengthDimension interface was extended to allow setting a custom dimension direction.
The value of dimension in this case is equal to projection of the distance between dimension attributes(points) to this direction.

vlengthparam command is implemented to set custom length direction in DRAW.

dox/user_guides/draw_test_harness/draw_test_harness.md
src/AIS/AIS_Dimension.cxx
src/AIS/AIS_Dimension.hxx
src/AIS/AIS_LengthDimension.cxx
src/AIS/AIS_LengthDimension.hxx
src/ViewerTest/ViewerTest_RelationCommands.cxx
tests/v3d/dimensions/lengthparam [new file with mode: 0644]
tests/v3d/dimensions/lengthparam_flyout_reversed [new file with mode: 0644]
tests/v3d/dimensions/lengthparam_reversed [new file with mode: 0644]
tests/v3d/dimensions/lengthparam_reversed_direction [new file with mode: 0644]
tests/v3d/dimensions/lengthparam_reversed_flyout_reversed [new file with mode: 0644]

index 37afc26001dc822efa6b1858ee516047d6fdf6a9..d20f593f3a47714f9fc8ecf0dbb33b3b8b68680e 100644 (file)
@@ -2506,7 +2506,7 @@ vdimparam dim1 -textvalue "w_1"
 vdimparam dim1 -autovalue
 ~~~~~
 
-@subsubsection occt_draw_4_4_22 vdimangleparam
+@subsubsection occt_draw_4_4_22 vangleparam
 
 Syntax:
 ~~~~~
@@ -2527,7 +2527,29 @@ vfit
 vangleparam dim1 -type exterior -showarrow first
 ~~~~~
 
-@subsubsection occt_draw_4_4_23 vmovedim
+@subsubsection occt_draw_4_4_23 vlengthparam
+
+Syntax:
+~~~~~
+vlengthparam name [-type interior|exterior]
+                  [-showarrow first|second|both|none]
+~~~~~
+
+Sets parameters for length dimension **name**.
+
+**Example:** 
+~~~~~
+vinit
+vpoint p1 20 20 0
+vpoint p2 80 80 0
+vdimension dim1 -length -plane xoy -shapes p1 p2
+vtop
+vfit
+vzoom 0.5
+vlengthparam dim1 -direction ox
+~~~~~
+
+@subsubsection occt_draw_4_4_24 vmovedim
 
 Syntax:
 ~~~~~
index 0d6d2499bb90e8500fec7066caa70d71b20cfcd8..f3ca7709e06376bae8fb9491a0754153114fb3ed 100755 (executable)
@@ -691,21 +691,9 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
   FitTextAlignmentForLinear (theFirstPoint, theSecondPoint, theIsOneSide, aHorisontalTextPos,
                              aLabelPosition, isArrowsExternal);
 
-    // compute dimension line points
-  gp_Ax1 aPlaneNormal = GetPlane().Axis();
-  gp_Dir aTargetPointsVector = gce_MakeDir (theFirstPoint, theSecondPoint);
-
-  // compute flyout direction vector
-  gp_Dir aFlyoutVector = aPlaneNormal.Direction() ^ aTargetPointsVector;
-
-  // create lines for layouts
-  gp_Lin aLine1 (theFirstPoint, aFlyoutVector);
-  gp_Lin aLine2 (theSecondPoint, aFlyoutVector);
-
-  // Get flyout end points
-  gp_Pnt aLineBegPoint = ElCLib::Value (ElCLib::Parameter (aLine1, theFirstPoint)  + GetFlyout(), aLine1);
-  gp_Pnt aLineEndPoint = ElCLib::Value (ElCLib::Parameter (aLine2, theSecondPoint) + GetFlyout(), aLine2);
-
+  // compute dimension line points
+  gp_Pnt aLineBegPoint, aLineEndPoint;
+  ComputeFlyoutLinePoints (theFirstPoint, theSecondPoint, aLineBegPoint, aLineEndPoint);
   gp_Lin aDimensionLine = gce_MakeLin (aLineBegPoint, aLineEndPoint);
 
   // compute arrows positions and directions
@@ -996,6 +984,27 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
   mySelectionGeom.IsComputed = Standard_True;
 }
 
+//=======================================================================
+//function : ComputeFlyoutLinePoints
+//purpose  :
+//=======================================================================
+void AIS_Dimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint,
+                                             gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint)
+{
+  // compute dimension line points
+  gp_Ax1 aPlaneNormal = GetPlane().Axis();
+  // compute flyout direction vector
+  gp_Dir aTargetPointsVector = gce_MakeDir (theFirstPoint, theSecondPoint);
+  gp_Dir aFlyoutVector = aPlaneNormal.Direction() ^ aTargetPointsVector;
+  // create lines for layouts
+  gp_Lin aLine1 (theFirstPoint, aFlyoutVector);
+  gp_Lin aLine2 (theSecondPoint, aFlyoutVector);
+
+  // Get flyout end points
+  theLineBegPoint = ElCLib::Value (ElCLib::Parameter (aLine1, theFirstPoint)  + GetFlyout(), aLine1);
+  theLineEndPoint = ElCLib::Value (ElCLib::Parameter (aLine2, theSecondPoint) + GetFlyout(), aLine2);
+}
+
 //=======================================================================
 //function : ComputeLinearFlyouts
 //purpose  :
index 498eaa04dbc4e3f4031505485800ef07fb058683..13cea1363214a62fcbbd42bca71023abd4445f2a 100755 (executable)
@@ -463,6 +463,14 @@ protected:
                                             const gp_Pnt& theSecondPoint,
                                             const Standard_Boolean theIsOneSide = Standard_False);
 
+  //! Computes points bounded the flyout line for linear dimension.
+  //! @param theFirstPoint [in] the first attach point of linear dimension.
+  //! @param theSecondPoint [in] the second attach point of linear dimension.
+  //! @param theLineBegPoint [out] the first attach point of linear dimension.
+  //! @param theLineEndPoint [out] the second attach point of linear dimension.
+  Standard_EXPORT virtual void ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint,
+                                                        gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint);
+
   //! Compute selection sensitives for linear dimension flyout lines (length, diameter, radius).
   //! Please note that this method uses base dimension properties: working plane and flyout length.
   //! @param theSelection [in] the selection structure to fill with selection primitives.
index 541dfe53061fcbba3099be6085d5c1a13ff82481..6b919881b67961f485eaf53dc1f8fe96ef04d41c 100755 (executable)
@@ -44,7 +44,8 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_LengthDimension,AIS_Dimension)
 //=======================================================================
 AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFirstFace,
                                           const TopoDS_Face& theSecondFace)
-: AIS_Dimension (AIS_KOD_LENGTH)
+: AIS_Dimension (AIS_KOD_LENGTH),
+  myHasCustomDirection (Standard_False)
 {
   SetMeasuredGeometry (theFirstFace, theSecondFace);
   SetFlyout (15.0);
@@ -56,7 +57,8 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFirstFace,
 //=======================================================================
 AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFace,
                                           const TopoDS_Edge& theEdge)
-: AIS_Dimension (AIS_KOD_LENGTH)
+: AIS_Dimension (AIS_KOD_LENGTH),
+  myHasCustomDirection (Standard_False)
 {
   SetMeasuredGeometry (theFace, theEdge);
   SetFlyout (15.0);
@@ -69,7 +71,8 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFace,
 AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint,
                                           const gp_Pnt& theSecondPoint,
                                           const gp_Pln& thePlane)
-: AIS_Dimension (AIS_KOD_LENGTH)
+: AIS_Dimension (AIS_KOD_LENGTH),
+  myHasCustomDirection (Standard_False)
 {
   SetMeasuredGeometry (theFirstPoint, theSecondPoint, thePlane);
   SetFlyout (15.0);
@@ -82,7 +85,8 @@ AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint,
 AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Shape& theFirstShape,
                                           const TopoDS_Shape& theSecondShape,
                                           const gp_Pln& thePlane)
-: AIS_Dimension (AIS_KOD_LENGTH)
+: AIS_Dimension (AIS_KOD_LENGTH),
+  myHasCustomDirection (Standard_False)
 {
   SetCustomPlane (thePlane);
   SetMeasuredShapes (theFirstShape, theSecondShape);
@@ -95,7 +99,8 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Shape& theFirstShape,
 //=======================================================================
 AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Edge& theEdge,
                                           const gp_Pln& thePlane)
-: AIS_Dimension (AIS_KOD_LENGTH)
+: AIS_Dimension (AIS_KOD_LENGTH),
+  myHasCustomDirection (Standard_False)
 {
   SetMeasuredGeometry (theEdge, thePlane);
   SetFlyout (15.0);
@@ -261,7 +266,13 @@ void AIS_LengthDimension::SetDisplayUnits (const TCollection_AsciiString& theUni
 //=======================================================================
 Standard_Real AIS_LengthDimension::ComputeValue() const
 {
-  return IsValid() ? myFirstPoint.Distance (mySecondPoint) : 0.0;
+  if (!IsValid())
+    return 0.0;
+
+  if (!myHasCustomDirection)
+    return myFirstPoint.Distance (mySecondPoint);
+
+  return fabs (gp_Vec(myFirstPoint, mySecondPoint).Dot (myDirection));
 }
 
 //=======================================================================
@@ -282,6 +293,35 @@ void AIS_LengthDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /
   DrawLinearDimension (thePresentation, theMode, myFirstPoint, mySecondPoint);
 }
 
+ //=======================================================================
+//function : ComputeFlyoutLinePoints
+//purpose  : 
+//=======================================================================
+void AIS_LengthDimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint,
+                                                   gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint)
+{
+  if (!myHasCustomDirection)
+  {
+    AIS_Dimension::ComputeFlyoutLinePoints (theFirstPoint, theSecondPoint, theLineBegPoint, theLineEndPoint);
+    return;
+  }
+
+  // find scalar of projection target vector (from start to second point) to flyout vector
+  gp_Ax1 aPlaneNormal = GetPlane().Axis();
+  gp_Vec aFlyoutNormalizedDir(aPlaneNormal.Direction() ^ myDirection);
+  aFlyoutNormalizedDir.Normalize();
+  Standard_Real aTargetProjectedToFlyout = gp_Vec(theFirstPoint, theSecondPoint).Dot (aFlyoutNormalizedDir);
+
+  gp_Dir aFlyoutVector = aFlyoutNormalizedDir;
+  // create lines for layouts
+  gp_Lin aLine1 (theFirstPoint, aFlyoutVector);
+  gp_Lin aLine2 (theSecondPoint, aFlyoutVector);
+
+  // Get flyout end points
+  theLineBegPoint = ElCLib::Value (ElCLib::Parameter (aLine1, theFirstPoint)  + GetFlyout() + aTargetProjectedToFlyout, aLine1);
+  theLineEndPoint = ElCLib::Value (ElCLib::Parameter (aLine2, theSecondPoint) + GetFlyout(), aLine2);
+}
+
 //=======================================================================
 //function : ComputeFlyoutSelection
 //purpose  : 
@@ -773,3 +813,14 @@ void AIS_LengthDimension::SetTextPosition (const gp_Pnt& theTextPos)
 
   SetToUpdate();
 }
+
+//=======================================================================
+//function : SetDirection
+//purpose  : 
+//=======================================================================
+void AIS_LengthDimension::SetDirection (const gp_Dir& theDirection, const Standard_Boolean theUseDirection)
+{
+  myHasCustomDirection = theUseDirection;
+  if (myHasCustomDirection)
+    myDirection = theDirection;
+}
index c5cbfce2ae6a870f9648ca6e399448c04da6c13f..867fe7257e3074f3a33278ee4187d4aaec42220a 100755 (executable)
@@ -194,6 +194,13 @@ public:
 
   Standard_EXPORT virtual const gp_Pnt GetTextPosition() const Standard_OVERRIDE;
 
+  //! Set custom direction for dimension. If it is not set, the direction is obtained
+  //! from the measured geometry (e.g. line between points of dimension)
+  //! The direction does not change flyout direction of dimension.
+  //! @param theDirection [in] the dimension direction.
+  //! @param theUseDirection [in] boolean value if custom direction should be used.
+  Standard_EXPORT void SetDirection (const gp_Dir& theDirection, const Standard_Boolean theUseDirection = Standard_True);
+
 public:
 
   DEFINE_STANDARD_RTTIEXT(AIS_LengthDimension,AIS_Dimension)
@@ -205,12 +212,25 @@ protected:
 
   Standard_EXPORT virtual gp_Pln ComputePlane(const gp_Dir& theAttachDir) const;
 
+  //! Computes distance between dimension points. If custom direction is defined, the distance
+  //! is a projection value of the distance between points to this direction
+  //! @return dimension value
   Standard_EXPORT Standard_Real ComputeValue() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
                                         const Handle(Prs3d_Presentation)& thePresentation,
                                         const Standard_Integer theMode = 0) Standard_OVERRIDE;
 
+  //! Computes points bounded the flyout line for linear dimension.
+  //! Direction of flyout line equal to the custom direction of dimension if defined or
+  //! parallel to the main direction line
+  //! @param theFirstPoint [in] the first attach point of linear dimension.
+  //! @param theSecondPoint [in] the second attach point of linear dimension.
+  //! @param theLineBegPoint [out] the first attach point of linear dimension.
+  //! @param theLineEndPoint [out] the second attach point of linear dimension.
+  Standard_EXPORT virtual void ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint,
+                                                        gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint) Standard_OVERRIDE;
+
   Standard_EXPORT virtual void ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection,
                                                        const Handle(SelectMgr_EntityOwner)& theEntityOwner) Standard_OVERRIDE;
 
@@ -263,6 +283,8 @@ private:
   gp_Pnt mySecondPoint;
   TopoDS_Shape myFirstShape;
   TopoDS_Shape mySecondShape;
+  gp_Dir myDirection;
+  Standard_Boolean myHasCustomDirection;
 };
 
 #endif // _AIS_LengthDimension_HeaderFile
index b855138f03120bafda777ab042d44ce7b5a4147d..9c7ad67415d39560526eea8290ce329f3b714bee 100644 (file)
@@ -74,6 +74,7 @@
 #include <TCollection_AsciiString.hxx>
 #include <TCollection_ExtendedString.hxx>
 #include <TColStd_MapOfInteger.hxx>
+#include <TColStd_SequenceOfReal.hxx>
 #include <TopAbs.hxx>
 #include <TopAbs_ShapeEnum.hxx>
 #include <TopExp.hxx>
@@ -348,7 +349,7 @@ static int ParseDimensionParams (Standard_Integer  theArgNum,
     {
       if (anIt + 1 >= theArgNum)
       {
-        std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n";
+        std::cout << "Error: wrong number of values for parameter '" << aParam << "'.\n";
         return 1;
       }
 
@@ -1622,6 +1623,109 @@ static int VDimParam (Draw_Interpretor& theDi, Standard_Integer theArgNum, const
   return 0;
 }
 
+//=======================================================================
+//function : VLengthParam
+//purpose  : Sets parameters to length dimension.
+//=======================================================================
+static int VLengthParam (Draw_Interpretor&, Standard_Integer theArgNum, const char** theArgVec)
+{
+  if (theArgNum < 3)
+  {
+    std::cout << theArgVec[0] << " error: the wrong number of input parameters.\n";
+    return 1;
+  }
+
+  TCollection_AsciiString aName (theArgVec[1]);
+  if (!GetMapOfAIS().IsBound2 (aName))
+  {
+    std::cout << theArgVec[0] << "error: no object with this name.\n";
+    return 1;
+  }
+
+  Handle(AIS_InteractiveObject) anObject = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2 (aName));
+  if (anObject->Type() != AIS_KOI_Dimension)
+  {
+    std::cout << theArgVec[0] << "error: no dimension with this name.\n";
+    return 1;
+  }
+  
+  Handle(AIS_LengthDimension) aLengthDim = Handle(AIS_LengthDimension)::DownCast (anObject);
+  if (aLengthDim.IsNull())
+  {
+    std::cout << theArgVec[0] << "error: no length dimension with this name.\n";
+    return 1;
+  }
+
+  // parse direction value
+  gp_Dir aDirection;
+  int anArgumentIt = 2;
+  TCollection_AsciiString aParam (theArgVec[anArgumentIt]);
+  aParam.LowerCase();
+
+  bool isCustomDirection = false;
+  if (aParam.IsEqual ("-direction"))
+  {
+    if (anArgumentIt + 1 >= theArgNum)
+    {
+      std::cout << "Error: "<< aParam <<" direction should have value.\n";
+      return 1;
+    }
+    anArgumentIt++;
+    isCustomDirection = Standard_True;
+    TCollection_AsciiString aValue = theArgVec[anArgumentIt];
+    aValue.LowerCase();
+    if (aValue == "ox")
+      aDirection = gp::DX();
+    else if (aValue == "oy")
+      aDirection = gp::DY();
+    else if (aValue == "oz")
+      aDirection = gp::DZ();
+    else if (aValue == "autodirection")
+      isCustomDirection = false;
+    else
+    {
+      if (anArgumentIt + 2 >= theArgNum)
+      {
+        std::cout << "Error: wrong number of values for parameter '" << aParam << "'.\n";
+        return 1;
+      }
+      // access coordinate arguments
+      TColStd_SequenceOfReal aCoords;
+      for (; anArgumentIt < theArgNum; ++anArgumentIt)
+      {
+        TCollection_AsciiString anArg (theArgVec[anArgumentIt]);
+        if (!anArg.IsRealValue())
+        {
+          break;
+        }
+        aCoords.Append (anArg.RealValue());
+      }
+      // non-numeric argument too early
+      if (aCoords.IsEmpty() || aCoords.Size() != 3)
+      {
+        std::cout << "Error: wrong number of direction arguments.\n";
+        return 1;
+      }
+      aDirection = gp_Dir (aCoords.Value (1), aCoords.Value (2), aCoords.Value (3));
+    }
+  }
+
+  aLengthDim->SetDirection (aDirection, isCustomDirection);
+  if (!aLengthDim->IsValid())
+  {
+    std::cout << "Error: Dimension geometry or plane is not valid.\n";
+    return 1;
+  }
+
+  // Redisplay a dimension after parameter changing.
+  if (ViewerTest::GetAISContext()->IsDisplayed (aLengthDim))
+  {
+    ViewerTest::GetAISContext()->Redisplay (aLengthDim, true);
+  }
+
+  return 0;
+}
+
 //=======================================================================
 //function : VAngleParam
 //purpose  : Sets aspect parameters to angle dimension.
@@ -1902,10 +2006,19 @@ void ViewerTest::RelationCommands(Draw_Interpretor& theCommands)
     " -See also: vmovedim, vdimension.\n",
     __FILE__,VDimParam,group);
 
+  theCommands.Add("vlengthparam",
+    "vlengthparam name"
+    "[-direction {ox|oy|oz|x y z|autodirection}]\n"
+    " -Sets parameters for length dimension.\n"
+    " -See also: vdimparam, vdimension.\n",
+    __FILE__,VLengthParam,group);
+
   theCommands.Add("vangleparam",
     "vangleparam name"
     "[-type interior|exterior]\n"
-    "[-showarrow first|second|both|none]\n",
+    "[-showarrow first|second|both|none]\n"
+    " -Sets parameters for angle dimension.\n"
+    " -See also: vdimparam, vdimension.\n",
     __FILE__,VAngleParam,group);
 
   theCommands.Add("vmovedim",
diff --git a/tests/v3d/dimensions/lengthparam b/tests/v3d/dimensions/lengthparam
new file mode 100644 (file)
index 0000000..bd5fca9
--- /dev/null
@@ -0,0 +1,31 @@
+pload ALL
+vinit
+vtrihedron t1
+
+vpoint p11 2 22 0
+vpoint p12 7 29 0
+vdimension dim1 -length -plane xoy -shapes p11 p12
+vdimparam dim1 -flyout 1 -arrowlength 0.75 -arrow internal -label hcenter
+
+vpoint p21 22 22 0
+vpoint p22 27 29 0
+vdimension dim2 -length -plane xoy -shapes p21 p22
+vdimparam dim2 -flyout 1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim2 -direction 1 1 1
+
+vpoint p31 2 2 0
+vpoint p32 7 9 0
+vdimension dim3 -length -plane xoy -shapes p31 p32
+vdimparam dim3 -flyout 1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim3 -direction OX
+
+vpoint p41 22 2 0
+vpoint p42 27 9 0
+vdimension dim4 -length -plane xoy -shapes p41 p42
+vdimparam dim4 -flyout 1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim4 -direction OY
+
+vtop
+vfit
+vzoom 0.75
+
diff --git a/tests/v3d/dimensions/lengthparam_flyout_reversed b/tests/v3d/dimensions/lengthparam_flyout_reversed
new file mode 100644 (file)
index 0000000..abb3bdf
--- /dev/null
@@ -0,0 +1,31 @@
+pload ALL
+vinit
+vtrihedron t1
+
+vpoint p11 2 22 0
+vpoint p12 7 29 0
+vdimension dim1 -length -plane xoy -shapes p11 p12
+vdimparam dim1 -flyout -1 -arrowlength 0.75 -arrow internal -label hcenter
+
+vpoint p21 22 22 0
+vpoint p22 27 29 0
+vdimension dim2 -length -plane xoy -shapes p21 p22
+vdimparam dim2 -flyout -1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim2 -direction 1 1 1
+
+vpoint p31 2 2 0
+vpoint p32 7 9 0
+vdimension dim3 -length -plane xoy -shapes p31 p32
+vdimparam dim3 -flyout -1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim3 -direction OX
+
+vpoint p41 22 2 0
+vpoint p42 27 9 0
+vdimension dim4 -length -plane xoy -shapes p41 p42
+vdimparam dim4 -flyout -1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim4 -direction OY
+
+vtop
+vfit
+vzoom 0.75
+
diff --git a/tests/v3d/dimensions/lengthparam_reversed b/tests/v3d/dimensions/lengthparam_reversed
new file mode 100644 (file)
index 0000000..867b5c7
--- /dev/null
@@ -0,0 +1,31 @@
+pload ALL
+vinit
+vtrihedron t1
+
+vpoint p11 2 22 0
+vpoint p12 7 29 0
+vdimension dim1 -length -plane xoy -shapes p12 p11
+vdimparam dim1 -flyout 1 -arrowlength 0.75 -arrow internal -label hcenter
+
+vpoint p21 22 22 0
+vpoint p22 27 29 0
+vdimension dim2 -length -plane xoy -shapes p22 p21
+vdimparam dim2 -flyout 1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim2 -direction 1 1 1
+
+vpoint p31 2 2 0
+vpoint p32 7 9 0
+vdimension dim3 -length -plane xoy -shapes p32 p31
+vdimparam dim3 -flyout 1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim3 -direction OX
+
+vpoint p41 22 2 0
+vpoint p42 27 9 0
+vdimension dim4 -length -plane xoy -shapes p42 p41
+vdimparam dim4 -flyout 1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim4 -direction OY
+
+vtop
+vfit
+vzoom 0.75
+
diff --git a/tests/v3d/dimensions/lengthparam_reversed_direction b/tests/v3d/dimensions/lengthparam_reversed_direction
new file mode 100644 (file)
index 0000000..e6031ce
--- /dev/null
@@ -0,0 +1,31 @@
+pload ALL
+vinit
+vtrihedron t1
+
+vpoint p11 2 22 0
+vpoint p12 7 29 0
+vdimension dim1 -length -plane xoy -shapes p11 p12
+vdimparam dim1 -flyout 1 -arrowlength 0.75 -arrow internal -label hcenter
+
+vpoint p21 22 22 0
+vpoint p22 27 29 0
+vdimension dim2 -length -plane xoy -shapes p21 p22
+vdimparam dim2 -flyout 1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim2 -direction -1 -1 1
+
+vpoint p31 2 2 0
+vpoint p32 7 9 0
+vdimension dim3 -length -plane xoy -shapes p31 p32
+vdimparam dim3 -flyout 1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim3 -direction -1 0 0
+
+vpoint p41 22 2 0
+vpoint p42 27 9 0
+vdimension dim4 -length -plane xoy -shapes p41 p42
+vdimparam dim4 -flyout 1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim4 -direction 0 -1 0
+
+vtop
+vfit
+vzoom 0.75
+
diff --git a/tests/v3d/dimensions/lengthparam_reversed_flyout_reversed b/tests/v3d/dimensions/lengthparam_reversed_flyout_reversed
new file mode 100644 (file)
index 0000000..d30ae25
--- /dev/null
@@ -0,0 +1,31 @@
+pload ALL
+vinit
+vtrihedron t1
+
+vpoint p11 2 22 0
+vpoint p12 7 29 0
+vdimension dim1 -length -plane xoy -shapes p12 p11
+vdimparam dim1 -flyout -1 -arrowlength 0.75 -arrow internal -label hcenter
+
+vpoint p21 22 22 0
+vpoint p22 27 29 0
+vdimension dim2 -length -plane xoy -shapes p22 p21
+vdimparam dim2 -flyout -1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim2 -direction 1 1 1
+
+vpoint p31 2 2 0
+vpoint p32 7 9 0
+vdimension dim3 -length -plane xoy -shapes p32 p31
+vdimparam dim3 -flyout -1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim3 -direction OX
+
+vpoint p41 22 2 0
+vpoint p42 27 9 0
+vdimension dim4 -length -plane xoy -shapes p42 p41
+vdimparam dim4 -flyout -1 -arrowlength 0.75 -arrow internal -label hcenter
+vlengthparam dim4 -direction OY
+
+vtop
+vfit
+vzoom 0.75
+