Skip to content
Snippets Groups Projects
Commit bc5f9f43 authored by Marcel Dreier's avatar Marcel Dreier
Browse files

misc things

parent 3a63ea1f
No related branches found
No related tags found
1 merge request!1feat: added visualisation for CircleFact; added Torus- and ConeGenerator
......@@ -1714,7 +1714,10 @@ public CircleFact(string Pid1, string Pid2, float radius, Vector3 normal, string
public new static CircleFact parseFact(Scroll.ScrollFact fact)
{
string uri = fact.@ref.uri;
string M_uri = "";
string A_uri = "";
float radius = 0.0f;
Vector3 normal = Vector3.zero;
OMA df = (OMA)((Scroll.ScrollSymbolFact)fact).df;
if (df == null)
......@@ -1723,22 +1726,66 @@ public CircleFact(string Pid1, string Pid2, float radius, Vector3 normal, string
Scroll.ScrollSymbolFact casted_fact = (Scroll.ScrollSymbolFact)fact;
// get the mid point uri
string parse_id_M = ParsingDictionary.MMTermToString(((OMA)casted_fact.df).arguments[1]);
Debug.Log("parse_id_M " + parse_id_M);
M_uri = ParsingDictionary.parseTermsToId[parse_id_M];
Debug.Log("M URI " + M_uri);
// get the radius
radius = ((OMF)((OMA)casted_fact.df).arguments[2]).f;
OMA planeOMA = (OMA)((OMA)casted_fact.df).arguments[0];
string planeApplicant = ((OMS)planeOMA.applicant).uri;
// Getting the plane
// IN case of a normale plane
if (planeApplicant.Equals(MMTURIs.pointNormalPlane))
{
Debug.Log("planeApplicant" + planeApplicant);
OMA pointAOMA = (OMA)planeOMA.arguments[0];
string parse_id_A = ParsingDictionary.MMTermToString(planeOMA.arguments[0]);
A_uri = ParsingDictionary.parseTermsToId[parse_id_A];
OMA n = (OMA)planeOMA.arguments[1];
Vector3 normal = new Vector3(((OMF)n.arguments[0]).f, ((OMF)n.arguments[1]).f, ((OMF)n.arguments[2]).f);
normal = new Vector3(((OMF)n.arguments[0]).f, ((OMF)n.arguments[1]).f, ((OMF)n.arguments[2]).f);
Debug.Log("Norm " + normal.ToString());
// get the mid point uri
string parse_id_M = ParsingDictionary.MMTermToString(((OMA)casted_fact.df).arguments[1]);
string M_uri = ParsingDictionary.parseTermsToId[parse_id_M];
}
// In case of parametrized plane
else if(planeApplicant.Equals(MMTURIs.ParametrizedPlane))
{
Debug.Log("planeApplicant" + planeApplicant);
OMA pointAOMA = (OMA)planeOMA.arguments[0];
string parse_id_A = ParsingDictionary.MMTermToString(planeOMA.arguments[0]);
string A_uri = ParsingDictionary.parseTermsToId[parse_id_A];
A_uri = ParsingDictionary.parseTermsToId[parse_id_A];
OMA vOMA = (OMA)planeOMA.arguments[1];
OMA wOMA = (OMA)planeOMA.arguments[2];
Vector3 v = new Vector3(((OMF)vOMA.arguments[0]).f, ((OMF)vOMA.arguments[1]).f, ((OMF)vOMA.arguments[2]).f);
Vector3 w = new Vector3(((OMF)wOMA.arguments[0]).f, ((OMF)wOMA.arguments[1]).f, ((OMF)wOMA.arguments[2]).f);
normal = Vector3.Cross(v, w).normalized;
Debug.Log("Para "+normal.ToString());
}
else {
Debug.Log("planeApplicant" + planeApplicant);
Debug.Log("?? " + MMTURIs.pointNormalPlane);
return null;
}
// get the radius
float radius = ((OMF)((OMA)casted_fact.df).arguments[2]).f;
if (StageStatic.stage.factState.ContainsKey(M_uri)
......@@ -1770,6 +1817,7 @@ private MMTDeclaration generateCircleFactDeclaration( string p1URI, string p2URI
PointFact p1 = _Facts[p1URI] as PointFact;
PointFact p2 = _Facts[p2URI] as PointFact;
List<MMTTerm> normalArgs = new List<MMTTerm>
{
new OMF(normal.x),
......
......@@ -38,8 +38,8 @@ public class MMTURICollection
public string ConeOfCircleApex = "http://mathhub.info/FrameIT/frameworld?FrameITCone?circleConeOf";
public string ParametrizedPlane = "http://mathhub.info/MitM/core/geometry?Geometry/Planes?ParametrizedPlane";
public string pointNormalPlane = "http://mathhub.info/MitM/core/geometry?Geometry/Planes?pointNormalPlane";
public string ParametrizedPlane = "http://mathhub.info/MitM/core/geometry?Planes?ParametrizedPlane";
public string pointNormalPlane = "http://mathhub.info/MitM/core/geometry?Planes?pointNormalPlane";
public string OnCircle = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?pointOnCircle";
public string AnglePlaneLine = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?angleCircleLine";
public string OrthoCircleLine ="http://mathhub.info/FrameIT/frameworld?FrameITCircle?orthogonalCircleLine";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment