1
$\begingroup$

Consider the following scene as an example:

scene=GeometricScene[{
    {"B","P","N","T"},{}
},{
    lH==Line[{"B","P"}],
    lV==Line[{"B","N"}],
    GeometricAssertion[lH,"Horizontal","Leftward"],
    GeometricAssertion[lV,"Vertical","Upward"],
    GeometricAssertion[{{"P"},{"T"}},{"OppositeSides",lV}],
    PlanarAngle[{"T","B","N"},"Counterclockwise"]==12\[Degree],
    EuclideanDistance["B","T"]==20,
    EuclideanDistance["T","P"]==35
}];

instance=RandomInstance[scene,RandomSeeding->0]

Gives an incorrect scene.

{PlanarAngle[{"P","B","N"}],PlanarAngle[{"P","B","T"}]}/\[Degree]/.instance["Points"]

Produces:

{161.143, 180.}

This is wrong, the expected answer was:

{90., 102.}

enter image description here


Also look at the following scene:

scene=GeometricScene[{
    {"NA","NB","NF","A","B","F"},{}
},{
    lA==Line[{"A","NA"}],
    lB==Line[{"B","NB"}],
    lF==Line[{"F","NF"}],
    GeometricAssertion[{lA,lB,lF},"Vertical","Upward"],
    GeometricAssertion[{{lA},{lB}},{"OppositeSides",lF}],
    PlanarAngle[{"NA","A","B"},"Clockwise"]==70\[Degree],
    PlanarAngle[{"NA","A","F"},"Clockwise"]==25\[Degree],
    PlanarAngle[{"NB","B","F"},"Clockwise"]==345\[Degree],
    EuclideanDistance["A","B"]==20.3,
    EuclideanDistance["A","NA"]==10,
    EuclideanDistance["B","NB"]==10,
    EuclideanDistance["F","NF"]==10
}];
instance=RandomInstance[scene,RandomSeeding->0]
{
    EuclideanDistance["A","F"],
    EuclideanDistance["B","F"]
}/.instance["Points"]//N

{13.6685, 6.78483}

In this scene, the GeometricAssertion on the lines being Upward aligned is ignored by the system. Also EuclideanDistance["A","NA"] is taken to be nearly zero even though I explicitly told it to make it 10.

The correct answer is:

{31.461, 22.3313}

$\endgroup$
6
  • $\begingroup$ Can't reproduce it. The above code produces {90., 102.} in 12.2 on Windows 10 Pro 64 bit. $\endgroup$
    – user64494
    Commented Apr 9, 2021 at 16:10
  • $\begingroup$ With 12.2.0 for Mac OS X x86 (64-bit) I get {161.145, 180.} $\endgroup$
    – Bob Hanlon
    Commented Apr 9, 2021 at 16:22
  • $\begingroup$ @user64494 are you using Wolfram Desktop or Mathematica? check your release id for the kernel, there are multiple 12.2 versions. Run SystemInformation["Kernel", "ReleaseID"] $\endgroup$
    – user13892
    Commented Apr 9, 2021 at 16:24
  • $\begingroup$ @user13892 - what do you get for EuclideanDistance["B", "N"] /. instance["Points"]? I get basically zero. What if you add the constraint EuclideanDistance["B", "N"] > 1 to your scene? $\endgroup$
    – Jason B.
    Commented Apr 9, 2021 at 17:19
  • $\begingroup$ @JasonB. Yes it is nearly zero and adding the constraint EuclideanDistance["B", "N"] > 1 does fix the issue. Look at the next example where EuclideanDistance["A","NA"] is ignored. $\endgroup$
    – user13892
    Commented Apr 9, 2021 at 18:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.