TSNLib Tutorial | |
Contents
Tutorial OverviewPlease note that prior to using this tutorial you should understand the basics of the Geometry Tutorial prior to looking at this tutorial. This Tutorial is designed as a set of exercises for the programmer to either work through or browse. This tutorial assumes a basic knowledge of the C++ language and some understanding of NURBS curves, surfaces, trimmed surfaces and solids. All of the source code in this tutorial is working code which can be found in the specified locations. Much of the source code shown here are portions of software we utilized for software testing, You may ignore the portions of the code which measure the time, number of surface evaluations and print the global solver statistics. Trimmed Surface Creation TutorialCreating correctly defined trimmed surfaces is essential. There are two different ways in which trimmed surfaces may be created. First you may create a trimmed surface (or face) directly from a surface and its parametric domain (IwBrep::CreateFaceFromSurface). You may also create a trimmed surface from the surface and a set of oriented boundary curves. This tutorial shows how this may be done. Our tutorial demonstrates the creation of a trimmed surface from class (IwCurveBoundedSurface) which mirrors the IGES trimmed surface structure. This code is actually used in our IGES processor to create trimmed surfaces. Note that this code allows you to add a trimmed surface to an already existing brep. It is possible to put multiple trimmed surfaces in a single brep. You need to first create a brep prior to invoking this method. The following code shows how you might set up a brep prior to calling the function:
Trimmed Surface Query TutorialThe following code segment is extracted from IwFace::Draw. It demonstrates how to extract the trimming information from the face and invoke the drawing routines to create an OpenGL trimmed surface. To get the face(s) of a brep use IwBrep::GetFaces.
Parsing the IwSolution ObjectThe IwTopologySolver (demonstrated below) produces an IwSolutionArray to store the result of a global solve. The IwSolutionArray is an array of IwSolution objects that represent individual solution points to the global problem being solved. To utilize the IwTopologySolver you will need to parse the IwSolution object to extract the required data. The IwSolution contains the objects (face, curve, edge, vertex) that yielded the given solution and corresponding parameteric values. This function demonstrates how to extract that information from the IwSolution and create a corresponding 3D point.
Trimmed Surface/Point Solver TutorialThe following code demonstrates the use of the IwTopologySolver to solve an operation between a brep and a point. This solver allows the user to find intersections (IW_SO_INTERSECT), minimum/maximum distance between the brep and the point (IW_SO_MINIMIZE/>IW_SO_MAXIMIZE), and points were the tangent plane of the trimmed surface is perpendicular to the vector to the point (IW_SO_NORMALIZE.
Trimmed Surface/Curve Solver TutorialThe following code demonstrates the use of the IwTopologySolver to solve an operation between a brep and a curve. This solver allows the user to find intersections (W_SO_INTERSECT, minimum/maximum distance between the brep and the curve (IW_SO_MINIMIZE IW_SO_MAXIMIZE), and points were the tangent plane of the trimmed surface and the tangent of the curve are perpendicular to the vector between the trimmed surface and the curve (IW_SO_NORMALIZE).
Trimmed Surface/Trimmed Surface Solver TutorialThe following code demonstrates the use of the IwTopologySolver to solve an operation between two breps with trimmed surfaces. This solver allows the user to find the minimum/maximum distance between two breps with trimmed surfaces(IW_SO_MINIMIZE IW_SO_MAXIMIZE, and points were the tangent planes of the trimmed surfaces of each are perpendicular to the vector between the two trimmed surface (IW_SO_NORMALIZE).
Planar Sectioning TutorialThis tutorial demonstrates how to do planar sectioning of a brep with trimmed surfaces. It creates a set of planes which span the bounding box of the brep and uses them to section the brep.
Point Classification TutorialThis tutorial demonstrates the classification of a parameter space point on a surface relative to the surface boundary. The function creates a grid of points in the parameter space of the surface and classifies them.
Curve Classification TutorialThis tutorial demonstrates the classification of a 2D curve relative to the boundary of a trimmed surface. Please note that the method being demonstrated here also allows you to specify a 3D curve. The method will automatically choose the correct place to classify the curve based on its dimension.
Solid Creation by Topology TablesThis tutorial shows the software necessary to create a Cube using the topology tables of the IwBrepData object. The IwBrepData object is the primary intermediate structure for input and output of topological objects (Trimmed Surfaces, Solids, Open Shells, Non-Manifold Models, etc.). You can read IwBrepData and write IwBrepData to and from ASCII files. The IwBrepData object is used as the intermediate structure for IGES reading of solids. Now to our example. Below is the code utilized to generate a Cube using the topology tables and an image showing the corresponding faces, edges, vertices, and edgeuses.
Surface FilletingPerhaps the best way to show you how to use filleting is to walk you through the little filleting application that is in iwfillet_test.cpp. It takes two trimmed surfaces and computes the starting points for the surface fillet solver to use in tracing out the rail curves. It does a relatively good job of computing all possible fillets and finding good starting points by intersecting the offset surfaces to get seed points for the surface fillet solver. It tests offsets in both directions for each surface. In some cases there are multiple correct answers to this problem. To further refine this function, it should take offset directions (positive or negative relative to the surface normal) for each surface.
Legal StuffAll of the software and documentation received with this release is copyrighted by Solid Modeling Solutions, Inc. You may not distribute source code or documentation for this software outside of the company and the site which owns the license. The standard license agreement allows you to freely distribute object code in any application which does not contain a programmatic interface. All software and documentation is considered proprietary information and the intellectual property of Solid Modeling Solutions, Inc. This document contains trade secret information which is deemed proprietary.Copyright © 1998-2010 Solid Modeling Solutions
All rights reserved. |