X3D-BREP project status

From Web3D.org
Revision as of 00:35, 13 October 2011 by Brutzman (Talk | contribs) (move page from member wiki to public wiki)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page provides a rough roadmap concerning the integration of BREP extensions into the X3D standard.

Project Description

Introduction

X3D-BREP project, alias CAD Component level 3, 4.

The CAD component is designed to store analytical geometries (i.e. geometries of exact precision) that are defined using a Boundary REPresentation scheme. The BREP description allows storing both product structure and geometrical features of the model. This component is meant to represent models coming from CAD systems using either parametric-surface NURBS representations (level 3), or equivalent-fidelity BREP representations (level 4).

Description:

  • Level 3: Each model is described as a conjunction of two sets: A set of geometries which are represented by NURBS surfaces (NurbsPatchSurface node) and NURBS trimming curves (NurbsCurve2D node),

plus a set of topological relations between these geometrical entities.

  • Level 4: Includes level 3 NURBS functionality, and further allows a geometrical entity to be stored as explicit BREP geometrical primitives (Sphere, Torus, Cylinder, Cone, Surface of revolution, Surface of linear extrusion, etc.)

Uses: Level 1 and 2 of the X3D CAD Geometry component (already specified) are meant to be used as a visualization format for representing CAD derived objects using existing X3D functionality.

Level 3 of the component is meant to be used as a representation or interchange format for CAD data using only NURBS surfaces and NURBS curves to keep implementation complexity lightweight, enabling mobile applications.

Level 4 can either be used as a representation format or an interchange format without data loss. Being more explicit, level 4 allows further uses of the X3D BREP representation, such as computing more precise and faster simulations. This accuracy is possible because the original CAD model precision may not have suffered from a NURBS downgrading approximation.

It is notable that offline tools can convert level 4 model data into level 3 model data for wider distribution using thinner clients.

The CAD component can also use X3D's ability to store metadata at the node level, which means that specific additional model information can be embedded within any node. This potentially allows for model indexing, application-specific linking, and embedding geometric and dimensional tolerances data.

The current X3D-BREP project efforts include the following:

  • Development of an ISO X3D CAD Geometry component amendment
  • Prototype implementation within Xj3D
  • Generation of test cases
  • Review and possible update of the X3D CADInterchange profile

Development of an ISO X3D cad component amendment

This section describes how a BREP object can be serialized using X3D-BREP data representations. A serialization consists of the grammar description and general guidelines concerning geometrical interpretation.

Prototype implementation within Xj3D

The implementation will consist in the integration of a X3D-BREP parser as well as a CAD BREP rendering kernel within Xj3D.

  • The parser interprets a X3D-BREP structure and provides an object-oriented description to feed the CAD kernel.
  • The CAD kernel will perform validation, and tesselation over an X3D-BREP structure. The output tesselated BREP-object will be integrated in the Xj3D scenegraph as an aggregation of atomic entities (triangles and quadrilaterals).

http://web3d.org/membership/login/groups/CAD/X3D-BREP/SchemaArchiBrepComponent.jpg

Generation of test cases

This effort includes the development of an ad-hoc converter to perform conversion of an input CAD file into an X3D file (enhanced via X3D-BREP nodes). CAD file-format conversions under development include OpenNurbs (3DM) and STEP. In the future, Solidworks may also be supported. This phase of work also includes the identification of meaningful test cases, expressed using any of the previously mentioned CAD formats.

http://web3d.org/membership/login/groups/CAD/X3D-BREP/ChaineConversion.jpeg

Status and Timeline

Production of updated ISO specification prose for X3D CAD component

As of March 3rd, we already have a draft specification. The state of this spec is as the following:

  • List of BREP geometrical entities is finalized and agreed by primary contributors EDF and Yumetech.
  • Topological structure of BREP object nodes is finalized.
  • BREP issues are subject to additional working-group review and test-case evaluation.
  • Issue under consideration: referencing mechanism needs to be compliant with the rest of the X3D specification (using indexes to deal with forward entity definitions).
  • Formal description of geometrical entities mostly matches the OpenCascade specification. Reformulation and further editorial work is needed.

Entity graph can be found in Annex

Status:

The next draft specification is being reviewed in March and at monthly intervals.

Prototype implementation within Xj3D

Tesselation is done statically, meaning that it is not recomputer on viewpoint properties change.

Work have been done to identify a suitable java-based CAD-kernel. We chose to use JGEOM (https://jgeom.dev.java.net/), which is now LGPL, there licence friendly with Xj3D. However, JGEOM had to be extended in order to support the following:

  • Definition of analytic trimming curves
  • Tessellation of trimmed surfaces: different tessellation methods have be tested including:
  • Multiple "rendering" methods: Points cloud, wire frame, shadowed.

Status:

  • CAD kernel is functional, however tessellation speed needs to be enhanced (takes over 5 seconds to tessellate a complex scene).
  • Changes have to be committed to JGEOM source tree.
  • Parser implementation has not yet started.
  • Prototype may be available before next SIGGRAPH (July 2009).

Generation of test cases

Focus has been put on OpenNurbs (3DM) [1] file specification and open-source API [2]. An exporter has been written which is taking a 3DM file and converting it into a neutral BREP format that JGEOM is able to read. Work has been done to make OpenNurbs formal definition of Nurbs surfaces compliant with X3D-BREP and JGEOM Nurbs definition (Knot vector size, span handling).

http://en.wiki.mcneel.com/content/upload/images/brep_structure.gif

STEP models will be interpreted via the OpenCascade API. OpenCascade can directly import STEP models, OpenCascade engine will then be interrogated to export convenient geometric entities to an X3D-BREP file.

Status:

Most OpenNurbs V4 testcases (http://download.rhino3d.com/download.asp?id=on4_samples) can be rendered with JGEOM. A converter for OpenNurbs -> X3D-BREP will be provided with the XJ3D prototype. No time schedule is provided yet concerning a STEP converter.

Results

Demonstration of using the Custom Quads tesselation method to process a trimmed Nurbs surface

http://web3d.org/membership/login/groups/CAD/X3D-BREP/maillageNurbs.jpg http://web3d.org/membership/login/groups/CAD/X3D-BREP/maillageNurbs2.jpg

Demonstration of rendering a complex OpenNurbs(.3dm) BREP testcase with JGEOM, using Java3D for rendering

http://web3d.org/membership/login/groups/CAD/X3D-BREP/dvdCaseClip.jpg

Demonstration of trimming a complex BREP object within JGEOM, using Java3D for rendering

http://web3d.org/membership/login/groups/CAD/X3D-BREP/TrimmingDemo.jpg

In Depth Format Presentation

Entity List

Topological Nodes

  • Edge
  • Face
  • Wire
  • Vertex
  • PointBREP : Container node for a set of vertices
  • WireBREP : Container node for a set of wires
  • ShellBREP : Container node for a set of faces
  • SolidBREP : Container node for a set of shells

Geometrical Nodes

  • BREPPlanarSurface
  • BREPSphericalSurface
  • BREPCylindricalSurface
  • BREPToroidalSurface
  • BREPEllipsoidalSurface
  • BREPConicalSurface
  • BREPSurfaceOfLinearExtrusion
  • BREPSurfaceOfRevolution
  • BREPCircle2D
  • BREPLine2D
  • BREPElipse2D

Referencing mechanism for Intra-BREP entities

Whereas the common referencing mechanism is DEF/USE in the X3D standard, but we chose to reference entities within a BREP object using indexes. DEF/USE does not allow forward referencing, therefore was not applicable here. Instead, entities are to be accessed through integer indexes, which represent their position in the corresponding parent's field. Indexes are stored in MFInt32 fields.

For instance, a ShellBREP is a set of vertices, curves, pcurves, edges, wires and faces. Its children topological edges have to reference geometrical representation, in the form of a 3D curve and/or pcurves. In the same manner, wire have to reference edges, and faces have to reference wires.

http://web3d.org/membership/login/groups/CAD/X3D-BREP/referencingMec.jpeg

3d Curves and PCurves

An edge can be defined by either a 3D curve or one/two PCurves given for one/two surfaces, or both.

A PCurve is a 2D geometrical representation of an edge, lying on the related face's support surface. It means that in order to compute 3D representation of an edge given a PCurve, the computation process will require to query also the corresponding 3D surface. Since an edge can be connected to two faces, there can exist up to two PCurves for an edge, each one being the edge 2D representation in UV space on the corresponding face's surface.

An edge is an entity than defines the border of a face. If the edge's geometrical representation is a 3D curve (and not PCurve), then it is assumed that the edge is lying on the edge's face. The implementation will have to deduce the UV parametrization of that supposedly lying edge onto the face's surface. (Because surface trimming is usually done in surface's UV space). This process is called : Point projection and invertion (The NURBS Book, p.229)

If both a 3D Curve and PCurves are supplied for an edge, we assume that the set of 3D coordinates representing that 3D curve and the ones that represent the 3D projected PCurves given their corresponding face's surface, are identical.

Vertex definition

TODO : move down tRange parameter to each curves definitions.

Vertices are defined in the form of a set of Coordinates, using a X3DCoordinateNode.

Edges boundaries

Edge boundaries can be defined by either 3D Vertices, or a tRange (= {tMin,tMax} ), associated with a local coordinate system.

Edges boundaries are defined using the previously stated vertex. An edge is associated to two Vertices, representing each of its ends. Those two vertices coordinates must be coincident with the 3D projected edge, given its tRange parameter and the edge's curve's local coordinate system.

DEF/USE Sample Scene

   ShellBrep {
      closed FALSE
      
      vertex [
         DEF VERT0 Vertex {
            point 0 0 0
         }
         DEF VERT1 Vertex {
            point 1 0 0
         }
         DEF VERT2 Vertex {
            point 0 1 0
         }
         DEF VERT3 Vertex {
            point 1 1 0
         }
      ]
      
      curve [
         DEF CURVE0 NurbsCurve {
            controlPoint Coordinate { point [0 0 0, 0 0 0, 1 0 0, 1 0 0] }
            weight []
            knot [1 1]
            order 1
         }
         DEF CURVE1 NurbsCurve {
            controlPoint Coordinate { point [1 0 0, 1 0 0, 1 1 0, 1 1 0] }
            weight []
            knot [1 1]
            order 1
         }
         DEF CURVE2 NurbsCurve {
            controlPoint Coordinate { point [1 1 0, 1 1 0, 0 1 0, 0 1 0] }
            weight []
            knot [1 1]
            order 1
         }
         DEF CURVE3 NurbsCurve {
            controlPoint Coordinate { point [0 1 0, 0 1 0, 0 0 0, 0 0 0] }
            weight []
            knot [1 1]
            order 1
         }
         
         DEF PCURVE0 NurbsCurve2D {
            controlPoint Coordinate { point [0 0, 0 0, 1 0, 1 0] }
            weight []
            knot [1 1]
            order 1
         }
         DEF PCURVE1 NurbsCurve2D {
           ...
         }
         DEF PCURVE2 NurbsCurve2D {
           ...
         }
         DEF PCURVE3 NurbsCurve2D {
            ...
         }
      ]
      edge [
         DEF EDGE0 Edge {
            curve USE CURVE0
            tRange [0,1]
            vertex [USE VERT0,USE VERT1]
            face [0]
            pcurve [ USE PCURVE0 ]
         }
         DEF EDGE1 Edge {
            curve USE CURVE1
            tRange [0,1]
            vertex [USE VERT1, USE VERT2]
            face [0]
            pcurve [ USE PCURVE1 ]
         }
         DEF EDGE2 Edge {
            curve USE CURVE2
            tRange [0,1]
            vertex [USE VERT2, USE VERT3]
            face [0]
            pcurve [ USE PCURVE2 ]
            
         }
         DEF EDGE3 Edge {
            curve USE CURVE3
            tRange [0,1]
            vertex [USE VERT3, USE VERT0]
            face [0]
            pcurve [ USE PCURVE3 ]             
         }
      ]
      wire [
         DEF WIRE0 Wire {
            closed TRUE
            edge [USE EDGE0, USE EDGE1, USE EDGE2, USE EDGE3]
            sense [TRUE,TRUE,TRUE,TRUE]             
         }
      ]
      
      surface [
         DEF SURFACE1 NurbsPatchSurface {
            ...
         }
      ]
      face [
         Face {
            surface USE SURFACE1
            uvbox [...]
            wire [USE WIRE0]
            outer [TRUE]
            orientation [TRUE]
         }
     ]
  }

Indexed Sample Scene

  ShellBrep {
     closed FALSE
     vertex Coordinate { 
      point [
        0 0 0
        1 0 0
        0 1 0
        1 1 0
     ] }
     curve [
        DEF CURVE0 NurbsCurve {
           controlPoint Coordinate { point [0 0 0, 0 0 0, 1 0 0, 1 0 0] }
           weight []
           knot [1 1]
           order 1
        }
        DEF CURVE1 NurbsCurve {
           controlPoint Coordinate { point [1 0 0, 1 0 0, 1 1 0, 1 1 0] }
           weight []
           knot [1 1]
           order 1
        }
        DEF CURVE2 NurbsCurve {
           controlPoint Coordinate { point [1 1 0, 1 1 0, 0 1 0, 0 1 0] }
           weight []
           knot [1 1]
           order 1
        }
        DEF CURVE3 NurbsCurve {
           controlPoint Coordinate { point [0 1 0, 0 1 0, 0 0 0, 0 0 0] }
           weight []
           knot [1 1]
           order 1
        }
        DEF PCURVE0 NurbsCurve2D {
           controlPoint Coordinate { point [0 0, 0 0, 1 0, 1 0] }
           weight []
           knot [1 1]
           order 1
        }
        DEF PCURVE1 NurbsCurve2D {
          ...
        }
        DEF PCURVE2 NurbsCurve2D {
          ...
        }
        DEF PCURVE3 NurbsCurve2D {
           ...
        }
     ]
     edge [
        DEF EDGE0 Edge {
           curve 0      # EDGE0
           tRange [0,1]
           vertex [0,1]
           face [0]     # FACE0
           pcurve [ 4 ]
        }
        DEF EDGE1 Edge {
           curve 1
           tRange [0,1]
           vertex [1, 2]
           face [0]
           pcurve [ 5 ]
        }
        DEF EDGE2 Edge {
           curve 2
           tRange [0,1]
           vertex [2, 3]
           face [0]
           pcurve [ 6 ]
        }
        DEF EDGE3 Edge {
           curve 3
           tRange [0,1]
           vertex [3, 0]
           face [0]
           pcurve [ 7 ]
        }
     ]
     wire [
        DEF WIRE0 Wire {
           closed TRUE
           edge [0, 1, 2, 3]
           sense [TRUE,TRUE,TRUE,TRUE]
        }
     ]
     surface [
        DEF SURFACE1 NurbsPatchSurface {
           ...
        }
     ]
     face [
        DEF FACE0 Face {
           surface 1
           uvbox [...]
           wire [0]
           outer [TRUE]
           orientation [TRUE]
        }
    ]
 }

Face Container Sample Scene

 #X3D V3.3 utf8
 PROFILE Immersive
 COMPONENT CADGeometry:4
ShellBrep {
 closed FALSE
 coord [
    DEF VERT0 Coordinate { point [ 0 0 0 ] } 
    DEF VERT1 Coordinate { point [ 1 0 0 ] } 
    DEF VERT2 Coordinate { point [ 0 1 0 ] } 
    DEF VERT3 Coordinate { point [ 1 1 0 ] } 
 ]    
    face [
       DEF FACE0 Face {
          surface DEF SURFACE1 NurbsPatchSurface {
             ...
          }
          uvbox [...]
          outerOrientation [TRUE]
          outerWire [
             DEF WIRE0 Wire {
                closed TRUE
                edge [  
                   DEF EDGE0 Edge {
                      curve  DEF CURVE0 NurbsCurve {
                         controlPoint Coordinate { point [0 0 0, 0 0 0, 1 0 0, 1 0 0] }
                         weight []
                         knot [1 1]
                         order 1
                      }
                      tRange [0,1]
                      minCoord USE VERT0
                      maxCoord USE VERT1
                      pcurve [ 
                         DEF PCURVE0 NurbsCurve2D {
                            controlPoint [0 0, 0 0, 1 0, 1 0]
                            weight []
                            knot [1 1]
                            order 1
                         }
                     ]
                   }
                   DEF EDGE1 Edge {
                      curve DEF CURVE1 NurbsCurve {
                         controlPoint Coordinate { point [1 0 0, 1 0 0, 1 1 0, 1 1 0] }
                         weight []
                         knot [1 1]
                         order 1
                      }
                      tRange [0,1]
                      minCoord USE VERT1
                      maxCoord USE VERT2
                      pcurve [ DEF PCURVE1 NurbsCurve2D { ... } ]
                   }
                  DEF EDGE2 Edge {
                     curve DEF CURVE2 NurbsCurve {
                        controlPoint Coordinate { point [1 1 0, 1 1 0, 0 1 0, 0 1 0] }
                        weight []
                        knot [1 1]
                        order 1
                     }
                     tRange [0,1]
                     minCoord USE VERT2
                     maxCoord USE VERT3
                     pcurve [ DEF PCURVE2 NurbsCurve2D { ... } ]
                  }
                  DEF EDGE3 Edge {
                     curve DEF CURVE3 NurbsCurve {
                        controlPoint Coordinate { point [0 1 0, 0 1 0, 0 0 0, 0 0 0] }
                        weight []
                        knot [1 1]
                        order 1
                     }
                     tRange [0,1]
                     minCoord USE VERT3
                     maxCoord USE VERT0
                     pcurve [ DEF PCURVE3 NurbsCurve2D { ... } ]
                  }
                ]
                sense [TRUE,TRUE,TRUE,TRUE]
             }
          ]
       }
   ]
 }
}


Shape {
  geometry USE FACE0
  appearance Appearance { material Material { } }
}

Face Container Coordinate Node Sample Scene

  ShellBrep {
     closed FALSE
     sense [TRUE]
     face [
        DEF FACE0 Face {
           surface DEF SURFACE1 NurbsPatchSurface {
              ...
           }
           uvbox [...]
           outer [TRUE]
           orientation [TRUE]
           wire [
              DEF WIRE0 Wire {
                 closed TRUE
                 edge [  
                    DEF EDGE0 Edge {
                       curve  DEF CURVE0 NurbsCurve {
                          controlPoint Coordinate { point [0 0 0, 0 0 0, 1 0 0, 1 0 0] }
                          weight []
                          knot [1 1]
                          order 1
                       }
                       tRange [0,1]
                       vertex [DEF COORD0 Coordinate { point [0 0 0] }, Coordinate { point [ 1 0 0] }]
                       pcurve [ 
                          DEF PCURVE0 NurbsCurve2D {
                             controlPoint Coordinate { point [0 0, 0 0, 1 0, 1 0] }
                             weight []
                             knot [1 1]
                             order 1
                          }
                      ]
                    }
                    DEF EDGE1 Edge {
                       curve DEF CURVE1 NurbsCurve {
                          controlPoint Coordinate { point [1 0 0, 1 0 0, 1 1 0, 1 1 0] }
                          weight []
                          knot [1 1]
                          order 1
                       }
                       tRange [0,1]
                       vertex [ Coordinate { point [ 1 0 0 ]}, Coordinate { point [ 0 1 0 ]}]
                       pcurve [ DEF PCURVE1 NurbsCurve2D { ... } ]
                    }
                   DEF EDGE2 Edge {
                      curve DEF CURVE2 NurbsCurve {
                         controlPoint Coordinate { point [1 1 0, 1 1 0, 0 1 0, 0 1 0] }
                         weight []
                         knot [1 1]
                         order 1
                      }
                      tRange [0,1]
                      vertex [ point [ 0 1 0 ]}, Coordinate { point [ 1 1 0 ]}]
                      pcurve [ DEF PCURVE2 NurbsCurve2D { ... } ]
                   }
                   DEF EDGE3 Edge {
                      curve DEF CURVE3 NurbsCurve {
                         controlPoint Coordinate { point [0 1 0, 0 1 0, 0 0 0, 0 0 0] }
                         weight []
                         knot [1 1]
                         order 1
                      }
                      tRange [0,1]
                      vertex [ point [ 1 1 0 ]}, USE COORD0]
                      pcurve [ DEF PCURVE3 NurbsCurve2D { ... } ]
                   }
                 ]
                 sense [TRUE,TRUE,TRUE,TRUE]
              }
           ]
        }
    ]
 }

SolidBrep Container Sample Scene

SolidBrep {

  breps [
  ShellBrep {
     closed FALSE
     coord DEF COORD0 Coordinate { 
      point [
        0 0 0
        1 0 0
        0 1 0
        1 1 0
     ] }
     face [
        DEF FACE0 Face {
           surface DEF SURFACE1 NurbsPatchSurface {
              ...
           }
           uvbox [...]
           outer [TRUE]
           orientation [TRUE]
           wire [
              DEF WIRE0 Wire {
                 closed TRUE
                 edge [  
                    DEF EDGE0 Edge {
                       curve  DEF CURVE0 NurbsCurve {
                          controlPoint Coordinate { point [0 0 0, 0 0 0, 1 0 0, 1 0 0] }
                          weight []
                          knot [1 1]
                          order 1
                       }
                       tRange [0,1]
                       vertex [0,1]
                       pcurve [ 
                          DEF PCURVE0 NurbsCurve2D {
                             controlPoint Coordinate { point [0 0, 0 0, 1 0, 1 0] }
                             weight []
                             knot [1 1]
                             order 1
                          }
                      ]
                    }
                    DEF EDGE1 Edge {
                       curve DEF CURVE1 NurbsCurve {
                          controlPoint Coordinate { point [1 0 0, 1 0 0, 1 1 0, 1 1 0] }
                          weight []
                          knot [1 1]
                          order 1
                       }
                       tRange [0,1]
                       vertex [1, 2]
                       pcurve [ DEF PCURVE1 NurbsCurve2D { ... } ]
                    }
                   DEF EDGE2 Edge {
                      curve DEF CURVE2 NurbsCurve {
                         controlPoint Coordinate { point [1 1 0, 1 1 0, 0 1 0, 0 1 0] }
                         weight []
                         knot [1 1]
                         order 1
                      }
                      tRange [0,1]
                      vertex [2, 3]
                      pcurve [ DEF PCURVE2 NurbsCurve2D { ... } ]
                   }
                   DEF EDGE3 Edge {
                      curve DEF CURVE3 NurbsCurve {
                         controlPoint Coordinate { point [0 1 0, 0 1 0, 0 0 0, 0 0 0] }
                         weight []
                         knot [1 1]
                         order 1
                      }
                      tRange [0,1]
                      vertex [3, 0]
                      pcurve [ DEF PCURVE3 NurbsCurve2D { ... } ]
                   }
                 ]
                 sense [TRUE,TRUE,TRUE,TRUE]
              }
           ]
        }
    ]
 }
  ShellBrep {
     closed FALSE
     coord USE COORD0
     sense [FALSE, TRUE]
     face [
        USE FACE0
        DEF FACE1 Face {
           surface DEF SURFACE2 NurbsPatchSurface {
              ...
           }
           uvbox [...]
           outer [TRUE]
           orientation [TRUE]
           wire [
              DEF WIRE0 Wire {
                 closed TRUE
                 edge [  
                    DEF EDGE0 Edge {
                       curve  USE CURVE0
                       tRange [0,1]
                       vertex [0,1]
                       pcurve [ 
                          DEF PCURVE4 NurbsCurve2D {
                             controlPoint Coordinate { point [0 0, 0 0, 1 0, 1 0] }
                             weight []
                             knot [1 1]
                             order 1
                          }
                      ]
                    }
                    DEF EDGE1 Edge {
                       curve USE CURVE1
                       tRange [0,1]
                       vertex [1, 2]
                       pcurve [ DEF PCURVE5 NurbsCurve2D { ... } ]
                    }
                   DEF EDGE2 Edge {
                      curve USE CURVE2
                      tRange [0,1]
                      vertex [2, 3]
                      pcurve [ DEF PCURVE6 NurbsCurve2D { ... } ]
                   }
                   DEF EDGE3 Edge {
                      curve USE CURVE3
                      tRange [0,1]
                      vertex [3, 0]
                      pcurve [ DEF PCURVE7 NurbsCurve2D { ... } ]
                   }
                 ]
                 sense [TRUE,TRUE,TRUE,TRUE]
              }
           ]
        }
    ]
 }

]}

Annexes

X3D-BREP entity graph

http://web3d.org/membership/login/groups/CAD/X3D-BREP/x-rotated.jpg

JGeom extension concerning trimming curves

http://web3d.org/membership/login/groups/CAD/X3D-BREP/JGeomExtension.jpg

Custom Quads tesselation method

http://web3d.org/membership/login/groups/CAD/X3D-BREP/MethodeTesselation.jpeg