@prefix :        <https://www.web3d.org/x3d/content/examples/Basic/development/Arc2dComponentPrototype.ttl#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema:  <http://schema.org/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix x3d:     <https://www.web3d.org/specifications/x3d-4.0.xsd#> .
@prefix x3do:    <https://www.web3d.org/specifications/X3dOntology4.0#> .

:X3D a owl:NamedIndividual, x3do:X3D ;
  x3do:hasHead :head ;
  x3do:hasScene :Scene ;
  x3do:profile 'Immersive' ;
  x3do:version '3.1' ;
  x3do:noNamespaceSchemaLocation 'https://www.web3d.org/specifications/x3d-3.1.xsd' .
:head a owl:NamedIndividual, x3do:head ;
  x3do:hasParent :X3D ;
  x3do:hasMeta :meta_1_1, :meta_1_2, :meta_1_3, :meta_1_4, :meta_1_5, :meta_1_6, :meta_1_7, :meta_1_8, :meta_1_9, :meta_1_10 .
:meta_1_1 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'Arc2dComponentPrototype.x3d' ;
  x3do:name 'title' .
:meta_1_2 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'X3D Geometry2D component node, implemented as prototype for backwards compatibility with VRML 97. Arc2D specifies a 2D linear circular arc.' ;
  x3do:name 'description' .
:meta_1_3 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'Christos Kalogrias, Don Brutzman, Ken Curtin, Duane Davis' ;
  x3do:name 'creator' .
:meta_1_4 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '14 November 2003' ;
  x3do:name 'created' .
:meta_1_5 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '20 October 2019' ;
  x3do:name 'modified' .
:meta_1_6 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/geometry2D.html' ;
  x3do:name 'reference' .
:meta_1_7 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'Geometry2D component node (Arc2D)' ;
  x3do:name 'subject' .
:meta_1_8 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'https://www.web3d.org/x3d/content/examples/Basic/development/Arc2dComponentPrototype.x3d' ;
  x3do:name 'identifier' .
:meta_1_9 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit' ;
  x3do:name 'generator' .
:meta_1_10 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '../license.html' ;
  x3do:name 'license' .
:meta dcterms:title "Arc2dComponentPrototype.x3d" .
:meta dcterms:description "X3D Geometry2D component node, implemented as prototype for backwards compatibility with VRML 97. Arc2D specifies a 2D linear circular arc." .
:meta dcterms:creator "Christos Kalogrias, Don Brutzman, Ken Curtin, Duane Davis" .
:meta dcterms:created "14 November 2003" .
:meta dcterms:modified "20 October 2019" .
:meta dcterms:reference "https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/geometry2D.html" .
:meta dcterms:subject "Geometry2D component node (Arc2D)" .
:meta dcterms:identifier "https://www.web3d.org/x3d/content/examples/Basic/development/Arc2dComponentPrototype.x3d" .
:meta dcterms:generator "X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit" .
:meta dcterms:license "../license.html" .
:Scene a owl:NamedIndividual, x3do:Scene ;
  x3do:hasParent :X3D ;
  x3do:hasChildren :WorldInfo_2_1 ;
  x3do:hasProtoDeclare :ProtoDeclare_2_2 .
:WorldInfo_2_1 a owl:NamedIndividual, x3do:WorldInfo ;
  x3do:hasParent :Scene ;
  x3do:title 'Arc2dComponentPrototype.x3d' .
:ProtoDeclare_2_2 a owl:NamedIndividual, x3do:ProtoDeclare ;
  x3do:hasParent :Scene ;
  x3do:hasProtoInterface :ProtoInterface_2_2_1 ;
  x3do:hasProtoBody :ProtoBody_2_2_2 ;
  x3do:name 'Arc2D' .
:ProtoInterface_2_2_1 a owl:NamedIndividual, x3do:ProtoInterface ;
  x3do:hasParent :ProtoDeclare_2_2 ;
  x3do:hasField :field_2_2_1_1, :field_2_2_1_2, :field_2_2_1_3, :field_2_2_1_4 .
:field_2_2_1_1 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'startAngle' ;
  x3do:type 'SFFloat' ;
  x3do:value 0 .
:field_2_2_1_2 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'endAngle' ;
  x3do:type 'SFFloat' ;
  x3do:value 1.5707963265 .
:field_2_2_1_3 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'radius' ;
  x3do:type 'SFFloat' ;
  x3do:value 1 .
:field_2_2_1_4 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'inputOutput' ;
  x3do:appinfo 'Metadata node only' ;
  x3do:name 'metadata' ;
  x3do:type 'SFNode' .
:ProtoBody_2_2_2 a owl:NamedIndividual, x3do:ProtoBody ;
  x3do:hasParent :ProtoDeclare_2_2 ;
  x3do:hasGeometry :ArcIndexPoints ;
  x3do:hasChildren :Group_2_2_2_2 .
:ArcIndexPoints a owl:NamedIndividual, x3do:IndexedLineSet ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:hasCoord :Arc3DPoints ;
  x3do:DEF 'ArcIndexPoints' .
:Arc3DPoints a owl:NamedIndividual, x3do:Coordinate ;
  x3do:hasParent :ArcIndexPoints ;
  x3do:DEF 'Arc3DPoints' .
:Group_2_2_2_2 a owl:NamedIndividual, x3do:Group ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:hasIS :IS_2_2_2_2_1 ;
  x3do:hasChildren :Arc2dToFaceSet3d ;
  x3do:hasROUTE :ROUTE_2_2_2_2_3, :ROUTE_2_2_2_2_4 .
:IS_2_2_2_2_1 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :Group_2_2_2_2 ;
  x3do:hasConnect :connect_2_2_2_2_1_1 .
:connect_2_2_2_2_1_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_2_1 ;
  x3do:nodeField 'metadata' ;
  x3do:protoField 'metadata' .
:Arc2dToFaceSet3d a owl:NamedIndividual, x3do:Script ;
  x3do:hasParent :Group_2_2_2_2 ;
  x3do:hasField :field_2_2_2_2_2_1, :field_2_2_2_2_2_2, :field_2_2_2_2_2_3, :field_2_2_2_2_2_4, :field_2_2_2_2_2_5 ;
  x3do:hasIS :IS_2_2_2_2_2_6 ;
  x3do:DEF 'Arc2dToFaceSet3d' ;
  x3do:sourceCode """
ecmascript:

function initialize()
{
   numOfPoints = 100;

   if (radius < 0)
   {
      Browser.println ('[Arc2D] Warning:  invalid value, radius=' + value + ' must instead be >= 0');
   }

   if ((startAngle < 0) || (startAngle >= 2 * Math.PI))
   {
      Browser.println ('[Arc2D] Warning: startAngle=' + startAngle + ' must be within range [0..2pi)');
   }

   if ((endAngle < 0) || (endAngle >= 2 * Math.PI))
   {
      Browser.println ('[Arc2D] Warning: endAngle=' + endAngle + ' must be within range [0..2pi)');
   }

   // equal startAngle, endAngle means draw full circle.
   // high out-of-range endAngle is OK for local computation.
   if (startAngle >= endAngle)
      endAngle += (2 * Math.PI);

   differAng = Math.abs((endAngle - startAngle))/numOfPoints;

   for (i = 0; i <= numOfPoints; i++)
   {
      arcSet3d[i] = new SFVec3f (radius * Math.cos(startAngle + i * differAng), radius * Math.sin(startAngle + i * differAng), 0.0);
      arcIndexSet3d[i] = i;
   }

} // initialize
""" .
:field_2_2_2_2_2_1 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :Arc2dToFaceSet3d ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'startAngle' ;
  x3do:type 'SFFloat' .
:field_2_2_2_2_2_2 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :Arc2dToFaceSet3d ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'endAngle' ;
  x3do:type 'SFFloat' .
:field_2_2_2_2_2_3 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :Arc2dToFaceSet3d ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'radius' ;
  x3do:type 'SFFloat' .
:field_2_2_2_2_2_4 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :Arc2dToFaceSet3d ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'arcSet3d' ;
  x3do:type 'MFVec3f' .
:field_2_2_2_2_2_5 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :Arc2dToFaceSet3d ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'arcIndexSet3d' ;
  x3do:type 'MFInt32' .
:IS_2_2_2_2_2_6 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :Arc2dToFaceSet3d ;
  x3do:hasConnect :connect_2_2_2_2_2_6_1, :connect_2_2_2_2_2_6_2, :connect_2_2_2_2_2_6_3 .
:connect_2_2_2_2_2_6_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_2_2_6 ;
  x3do:nodeField 'startAngle' ;
  x3do:protoField 'startAngle' .
:connect_2_2_2_2_2_6_2 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_2_2_6 ;
  x3do:nodeField 'endAngle' ;
  x3do:protoField 'endAngle' .
:connect_2_2_2_2_2_6_3 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_2_2_6 ;
  x3do:nodeField 'radius' ;
  x3do:protoField 'radius' .
:ROUTE_2_2_2_2_3 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :Group_2_2_2_2 ;
  x3do:fromField 'arcSet3d' ;
  x3do:fromNode 'Arc2dToFaceSet3d' ;
  x3do:toField 'point' ;
  x3do:toNode 'Arc3DPoints' .
:ROUTE_2_2_2_2_4 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :Group_2_2_2_2 ;
  x3do:fromField 'arcIndexSet3d' ;
  x3do:fromNode 'Arc2dToFaceSet3d' ;
  x3do:toField 'set_coordIndex' ;
  x3do:toNode 'ArcIndexPoints' .
