A 15 minute Primer to Parasolid Geometry Modeler
Let me start with a layman’s definition first. To create real-world objects, you use materials and manufacture things. To create the objects in the computer (or digital) world, you can use Parasolid. Parasolid is like a tool which allows you to create objects in the digital world.
Now, here’s the same in technical jargon – Parasolid provides high performance modelling which gives the ability to create new models or edit existing models using an unparalleled range of tools. It offers more than 900 functions which supports a range of modeling techniques, including solid modeling, direct editing, and free-form surface/sheet modeling etc.
The major areas of functionality supported include:
- Complex blending
- Hollowing, shelling, offsetting and thickening of surfaces
- Tapering and parting line calculations
- Local operations
- Complex modelling using B-surfaces
- Convergent Modeling technology
- Rendering support for large models
- Application support
Parasolid enables the support to import and export 3D models in alternative formats. Parasolid also offers the accuracy ratio of 1.0e11, which is an order of magnitude more accurate than that of any other kernel modeler.
The Parasolid API is C-callable, so that it can be integrated into any C or C++ application code. A binding for C# is also available, allowing you to call the Parasolid API from C# code.
1. Parasolid comes with a very nice and descriptive documentation, whenever you start working on Parasolid please go through the Functional Description section of the document it covers most of the basic and advanced concepts which are very helpful. You can also search anything in Parasolid documentation using keywords.
2. Registering the frustrum to a session, whenever you start working on Parasolid you need to define a frustrum and session for your application. Before you can start the modeler and make PK calls, you need to register the frustrum functions with Parasolid session. Frustrum contains functions that you need to supply in order to build a working session for your application.
Some functions are optional, what you need to supply depends on the required functionality of your application, like File handling, Memory management and Graphical output frustrum functions.
Parasolid Jumpstart Kit comes with the example application which has its own session and frustrum files. You can use it in your application (or you can create your own), if you are working on Mac then you can not directly use the session and frustrum files (you need to make some changes in files to make it compatible for Xcode).
3. Every Parasolid API returns a PK error code, you can use these error codes (by searching it in Parasolid document) to find out why the API is failing. This is very useful for fixing the problem.
4. Every unit in Parasolid is in meters (its size box is 1000 x 1000 x 1000 in meters), so if you are exporting some model in Parasolid then you have to scale the model in meters else sometimes your model will not appear in the view and you will also get out of size box fault.
5. If you are working on a model which is having very small tolerance then you can also change the precision of the Parasolid session, this can improve the body results.
6. While transmitting files in Parasolid you can create a separate file (M_T) having Mesh data. But if you want to embed Mesh data in a single file then you have to select a binary (X_B) file while transmitting (X_T (text) file option does not work with embed Mesh option).
7. If you are working on exporting some model in Parasolid (having Mesh geometry) then always triangulate the Mesh facet because Parasolid supports only triangular facets.
8. You have to enable the facet geometry in session if you want to create a polyline geometry in Parasolid.
9. Some Parasolid API returns data in a form of pointers so whenever you are done with the data then it’s your responsibility to free the memory for the same. Parasolid also provides API’s to free memory which you can use to free the memory of the pointer.
10. You can use the standard Parasolid attribute for setting name, color, transparency, etc on body, part, face, assembly or instance. You can also create your own new attribute and apply it on model.
11. After creating a geometry like curve or surface in Parasolid you can use the Geom check API to check if there is any fault. Degeneracy and self intersecting are the common faults that can be found in curves and surfaces. Parasolid also provides different APIs which can be used for finding and fixing such problems on curves and surfaces. Sometimes while fixing degeneracy or self intersecting problems, Parasolid fix APIs sometimes split a curve or surface so you need to take care of these splits.
12. You can also check faults on Body by using a body check API, if there is any fault on face or edge then you can easily resolve the faults using face repair and edge repair API. If Parasolid repair APIs are still not able to fix the faults then you can also go for Parasolid BodyShop toolkit. Parasolid Bodyshop is a toolkit that repairs, optimizes and validates CAD data imported into Parasolid for downstream modeling operations like – Import, Cleaning, Optimization, Fidelity and Export. Parasolid Bodyshop toolkit has a separate license.
13. Few Parasolid APIs take some standard forms of structure object as input which are declared using ‘_t’, initialized using ‘#defined’ ending with ‘_m’. And its memory is freed by using the ‘_f’ function (refer below image).
14. You can create a body from the surface in Parasolid using a UV box but if the surface is trimmed then we can create the body from the surface using the trimming API. Trimming API takes surface and trimming curve data as input, you need to provide the correct curve trim loop and set for trimming. Tolerance also plays an important role in trimming a surface. If you want to give a range of tolerance values for trimming surfaces API then you have to recreate the surface and trimming curve data. Because once the surface and trimming curve is passed to the trimming API (and trimming got failed) you cannot use that data again for trimming with new tolerance. You can also create a trimming body by imprinting a curve on the body but this will make our aplaition slow because imprinting is a heavy operation.
15. For receiving parts from older Parasolid X_T files you need a corresponding schema file. Parasolid setup comes with a schema folder, you can either set the schema folder path in ‘P_SCHEMA’ environment variable and use it in the session/frustrum or you can also keep a copy of schema folder with your project like it is done in Example App provided by Parasolid.
ProtoTech has a very strong background in working with Parasolid and other geometry modeler API (viz. ACIS, Granite, Open Cascade etc.) software. We have expertise in importing geometry to Parasolid as well as exporting it out to other systems or file formats..
If you have an application that requires you to integrate and use Parasolid library, our team of expert developers can help you with the following:
1. Integrate Parasolid SDK within a project using CMake files (on Visual studio and Xcode)
2. Cross platform application creation (for Windows and Mac) using C/C++ SDK code of Parasolid
3. Support all types of curves and surfaces like – line, polyline(facet geometry), BCurve, arc, circular, Planer surface, BSurface, Sweep surface, Spun surface etc
4. Brep geometry creation using topology approach or Trim surface (Sewing a surface to form solid/sheet geometry) approach
5. Mesh geometry creation and tessellation in Parasolid (Convergent Modeling)
6. Surface/solid body creation using profiling (extrude)
7. Write (name, color, translucency, invisibility, etc) attribute on body, assembly, instance face or edge
8. Frustrum/session creation and instantiation for an application (Windows and Mac both)
9. Transmit or Receive a Part, session or partition in an application
10. Maintain model hierarchy or create flatten model hierarchy for a model
11. Body healing – fault check and fixing the faults using body healing APIs
12. Boolean operation (subtract, intersect, unite) within geometries
13. Model Analysis using Body Compare, Mass properties, Validity etc
14. Journal Report and Debug XML creation for an API
15. Test Suit: Create a high level integration test case using google test suit to automate testing