Skip to content

Commit

Permalink
Nxquadric 1 (#627)
Browse files Browse the repository at this point in the history
* Add the NXquadric NXDL XML files

NXDL description XML files for the three NXquadric and constructive solid geometry classes.

* Create example data folder

* Add an example NeXus file using NXquadric

* Delete deleteme.txt

Delete the dummy file

* Delete sample_capillary.nxs

* Add close tag and rename field

Add the field close tag and rename the 'type' field to 'surface_type'.

* Add missing '>'

* Correct close tag
  • Loading branch information
tcspain authored and zjttoefs committed Oct 24, 2018
1 parent e4891f8 commit 4fc648d
Show file tree
Hide file tree
Showing 3 changed files with 231 additions and 0 deletions.
87 changes: 87 additions & 0 deletions contributed_definitions/NXcsg.nxdl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="nxdlformat.xsl" ?>
<!--
# NeXus - Neutron and X-ray Common Data Format
#
# Copyright (C) 2008-2018 NeXus International Advisory Committee (NIAC)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# For further information, see http://www.nexusformat.org
-->
<definition name="NXcsg"
extends="NXobject"
type="group"
category="contributed"
xmlns="http://definition.nexusformat.org/nxdl/3.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd"
>
<doc>
constructive solid geometry NeXus class, using :ref:`NXquadric`
and :ref:`NXoff_geometry`.
</doc>
<field
name="operation">
<doc>
One of the standard construction solid geometry set operations,
or if the CSG is a pointer to the geometry provided by an
:ref:`NXquadric` or an :ref:`NXoff_geometry`. Takes values:
</doc>
<enumeration>
<item value="UNION" />
<item value="INTERSECTION" />
<item value="DIFFERENCE" />
<item value="COMPLEMENT" />
<item value="IS_QUADRIC" />
<item value="IS_MESH" />
</enumeration>
</field>
<group
name="a"
type="NXcsg"
minOccurs="0"
maxOccurs="1">
<doc>
The first operand of constructive solid geometry
operation. Compulsory if 'operation' is UNION, INTERSECTION,
DIFFERENCE or COMPLEMENT.
</doc>
</group>
<group
name="b"
type="NXcsg"
minOccurs="0"
maxOccurs="1">
<doc>
The second operand of constructive solid geometry
operation. Compulsory if 'operation' is UNION, INTERSECTION or
DIFFERENCE.
</doc>
</group>
<field
name="geometry"
type="NX_CHAR"
minOccurs="0"
maxOccurs="1">
<doc>
Path to a field that is either an :ref:`NXquadric` (if
'operation' = IS_QUADRIC) or an :ref:`NXoff_geometry` (if
'operation' = IS_MESH) that defines the surface making up the
constructive solid geometry component. Compulsory if 'operation'
is IS_QUADRIC or IS_MESH.
</doc>
</field>
</definition>
88 changes: 88 additions & 0 deletions contributed_definitions/NXquadric.nxdl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="nxdlformat.xsl" ?>
<!--
# NeXus - Neutron and X-ray Common Data Format
#
# Copyright (C) 2008-2018 NeXus International Advisory Committee (NIAC)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# For further information, see http://www.nexusformat.org
-->
<definition name="NXquadric"
extends="NXobject"
type="group"
category="contributed"
xmlns="http://definition.nexusformat.org/nxdl/3.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd"
>
<doc>definition of a quadric surface.</doc>
<field
name="parameters"
type="NX_NUMBER"
units="NX_PER_LENGTH">
<doc>
Ten real values of the matrix that defines the quadric surface
in projective space. Ordered Q11, Q12, Q13, Q22, Q23, Q33, P1,
P2, P3, R. Takes a units attribute of dimension reciprocal
length. R is scalar. P has dimension reciprocal length, and the
given units. Q has dimension reciprocal length squared, and
units the square of those given.
</doc>
<dimensions>
<dim index = "1" value="10"/>
</dimensions>
</field>
<field
name="surface_type"
minOccurs="0"
maxOccurs="1">
<doc>
An optional description of the form of the quadric surface:
</doc>
<enumeration>
<item value="ELLIPSOID" />
<item value="ELLIPTIC_PARABOLOID" />
<item value="HYPERBOLIC_PARABOLOID" />
<item value="ELLIPTIC_HYPERBOLOID_OF_1_SHEET" />
<item value="ELLIPTIC_HYPERBOLOID_OF_2_SHEETS" />
<item value="ELLIPTIC_CONE" />
<item value="ELLIPTIC_CYLINDER" />
<item value="HYPERBOLIC_CYLINDER" />
<item value="PARABOLIC_CYLINDER" />
<item value="SPHEROID" />
<item value="SPHERE" />
<item value="PARABOLOID" />
<item value="HYPERBOLOID_1_SHEET" />
<item value="HYPERBOLOID_2_SHEET" />
<item value="CONE" />
<item value="CYLINDER" />
<item value="PLANE" />
<item value="IMAGINARY" />
<item value="UNKNOWN" />
</enumeration>
</field>
<field
name="depends_on"
type="NX_CHAR"
minOccurs="0"
maxOccurs="1">
<doc>
Path to an :ref:`NXtransformations` that defining the axis on
which the orientation of the surface depends.
</doc>
</field>
</definition>
56 changes: 56 additions & 0 deletions contributed_definitions/NXsolid_geometry.nxdl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="nxdlformat.xsl" ?>
<!--
# NeXus - Neutron and X-ray Common Data Format
#
# Copyright (C) 2008-2018 NeXus International Advisory Committee (NIAC)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# For further information, see http://www.nexusformat.org
-->
<definition name="NXsolid_geometry"
extends="NXobject"
type="group"
category="contributed"
xmlns="http://definition.nexusformat.org/nxdl/3.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd"
>
<doc>
the head node for constructively defined geometry
</doc>
<group
type="NXquadric"
minOccurs="0">
<doc>
Instances of :ref:`NXquadric` making up elements of the geometry.
</doc>
</group>
<group
type="NXoff_geometry"
minOccurs="0">
<doc>
Instances of :ref:`NXoff_geometry` making up elements of the geometry.
</doc>
</group>
<group
type="NXcsg"
minOccurs="0">
<doc>
The geometries defined, made up of instnances of :ref:`NXquadric` and :ref:`NXoff_geometry`.
</doc>
</group>
</definition>

0 comments on commit 4fc648d

Please sign in to comment.