Skip to content
Snippets Groups Projects
Commit 38f115d9 authored by Paul-Walcher's avatar Paul-Walcher
Browse files

Fixed Circle Fact

parent 54e017e0
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor.Callbacks;
using UnityEngine;
/// <summary>
......@@ -100,7 +101,25 @@ public CircleFact(string Pid1, string Pid2, float radius, Vector3 normal, SOMDoc
if (planeApplicant.Equals(MMTConstants.pointNormalPlane))
{
//OMA pointAOMA = (OMA)planeOMA.arguments[0];
normal = SOMDoc.MakeVector3((OMA)planeOMA.arguments[1]);
//normal = SOMDoc.MakeVector3((OMA)planeOMA.arguments[1]);
string planeOMAuri1, planeOMAuri2, planeOMAuri3;
planeOMAuri1 = planeOMA.arguments[0].ToString();
planeOMAuri2 = planeOMA.arguments[1].ToString();
planeOMAuri3 = planeOMA.arguments[2].ToString();
PointFact planeOMApf1, planeOMApf2, planeOMApf3;
planeOMApf1 = (PointFact)FactRecorder.AllFacts[planeOMAuri1];
planeOMApf2 = (PointFact)FactRecorder.AllFacts[planeOMAuri2];
planeOMApf3 = (PointFact)FactRecorder.AllFacts[planeOMAuri3];
Vector3 p1 = planeOMApf1.Point, p2 = planeOMApf2.Point, p3 = planeOMApf3.Point;
Vector3 v1 = p2 - p1, v2 = p3 - p1;
normal = Vector3.Cross(v1, v2);
}
// In case of parametrized plane
else if (planeApplicant.Equals(MMTConstants.ParametrizedPlane))
......@@ -114,10 +133,24 @@ public CircleFact(string Pid1, string Pid2, float radius, Vector3 normal, SOMDoc
else throw new ArgumentException("Invalid planeApplicant: " + planeApplicant);
// get the mid point uri
string parse_id_M = df.arguments[1].ToString();
string M_uri = ParsingDictionary.parseTermsToId[parse_id_M];
string A_uri = ParsingDictionary.parseTermsToId[planeOMA.arguments[0].ToString()];
float radius = ((OMLIT<float>)df.arguments[2]).value;
string M_uri = df.arguments[1].ToString();
string A_uri = planeOMA.arguments[0].ToString();
//float radius = ((OMLIT<float>)df.arguments[2]).value;
float radius = 0.0F;
OMA commonOMA = (OMA)df.arguments[2];
string uri1, uri2;
uri1 = commonOMA.arguments[0].ToString();
uri2 = commonOMA.arguments[1].ToString();
PointFact pf1, pf2;
pf1 = (PointFact)FactRecorder.AllFacts[uri1];
pf2 = (PointFact)FactRecorder.AllFacts[uri2];
radius = Vector3.Distance(pf1.Point, pf2.Point);
if (!FactRecorder.AllFacts.ContainsKey(M_uri)
|| !FactRecorder.AllFacts.ContainsKey(A_uri))
......
......@@ -49,7 +49,7 @@ public static class MMTConstants
public static readonly string ConeOfCircleApex = "http://mathhub.info/FrameIT/frameworld?FrameITCone?circleConeOf";
public static readonly string ParametrizedPlane = "http://mathhub.info/MitM/core/geometry?Planes?ParametrizedPlane";
public static readonly string pointNormalPlane = "http://mathhub.info/MitM/core/geometry?Planes?pointNormalPlane";
public static readonly string pointNormalPlane = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?pointsToPlaneNormal";
public static readonly string OnCircle = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?pointOnCircle";
public static readonly string AnglePlaneLine = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?angleCircleLine";
public static readonly string OrthoCircleLine = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?orthogonalCircleLine";
......@@ -123,6 +123,7 @@ public static class MMTConstants
public const string ScrollCylinderVolumeScroll = "http://mathhub.info/FrameIT/frameworld?CylinderVolumeScroll";
public const string ScrollCircleLineAngleToAngleScroll = "http://mathhub.info/FrameIT/frameworld?CircleLineAngleToAngleScroll";
public const string ScrollMidpoint = "http://mathhub.info/FrameIT/frameworld?Midpoint";
public const string ScrollMidpoint2 = "http://mathhub.info/FrameIT/frameworld?Midpoint";
public const string ScrollTest = "http://mathhub.info/FrameIT/frameworld?Test";
public const string ScrollCircleScroll = "http://mathhub.info/FrameIT/frameworld?CircleScroll";
public const string ScrollCircleLineAngleScroll = "http://mathhub.info/FrameIT/frameworld?CircleLineAngleScroll";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment