WSM API v25.0.0 (2025.0.0)
Loading...
Searching...
No Matches
WSM Topics

WSM Topics

Overview

WSM is a polyhedral geometric modeling kernel. It supports the following topology, similar to ASM (Autodesk Shape Manager):

In WSM, Edges are linear and Faces are planar. Smooth curves and surfaces are approximated.

Object Types

Object is the base class for all objects that support operations such as undo/redo, save/restore, etc.
Topology and other derived object types are not exposed directly in the WSM public interface.
Rather, object instances are manipulated by referencing their Object IDs.

Topology Types

WSM supports the following topology object types:

  • Vertex: A point in space. Represented by a 3D point and vector of owning Edges.
  • Edge: A bounded line in space. Represented by one or two Vertices.
  • Coedge: Connects Edges together into a Loop. Represented by an owning Loop, and pointers to an Edge, as well as previous, next, and partner Coedges.
  • Loop: The boundary of a Face. Represented by an owning Face and a pointer to the first Coedge.
  • Face: A bounded piece of a plane. Represented by one or more Loops.
  • Shell: A set of connected Faces. Represented by one or more Faces.
  • Lump: A connected volume in space; could have zero volume, i.e. a sheet. Represented by one outer Shell and zero or more inner Shells.
  • Body: A volume in space; could have zero volume, i.e. a sheet. Represented by spatially distinct Lumps.

Other Object Types

WSM also supports the supports the following object types:

  • Material
  • Texture
  • Image
  • Satellite Data
  • Level - z height (Architecture)
  • Layer - visiblity control
  • SketchProperties (local coordinate system)
  • Attribute:
    • Used to connect Objects to Materials, Levels, and Layers
    • Stores model properties, e.g. Edge style, Face UV data, Object properties (name, levels on/off)
    • Attributes migrate on split, copy, merge
      • Behavior can be specified (like ASM)
    • Used to identify circle and spline curves
    • Used to identify cylinder, sphere, and extrude surfaces.

WSM Functionality

WSM supports:

  • 3D sketching
  • Drag Face
  • Move Object
  • Offset Face
  • Taper
  • Repair
  • Booleans:
    • Unite
    • Subtract
    • Slice
    • Imprint
  • Undo/redo
  • History based collaboration
  • Ray fire and frustum picking
  • Group
  • Array
  • Sweep
  • Cover
  • Loft
  • Offset/Shell
  • Blend
  • Transform including non-uniform scale and mirror
  • Validity testing

Supporting Classes

The WSM API exposes the following supporting classes, data structures, constants and macros for:

History Management

WSM history management is implemented using 3 classes: History, which contains two vectors, namely ObjectHistory, and Delta.

History is used to store undo and redo information, and provide history related facilities for the rest of WSM code. Each Object has an ID that is unique in its History.
The Object ID is the index into the ObjectHistory vector.
The Delta vector contains a vector of IDs.

There may be several unrelated history streams (History instances), each maintaining model data unrelated to data in other history streams, i.e. all Object IDs, Delta timestamps, active Delta index, etc. are unique and make sense only within a given history stream. The data structure within a single history stream is illustrated by the following simplified diagram (some class variables are omitted for clarity):

Data structure within a single history stream

The actual objects, one instance per the Object version, are owned by an ObjectHistory instance corresponding to this Object: the size_t value returned by Object::GetID() can be used to access this Object's history via History::m_aObjectHistories in the given history stream. Note that to uniquely identify an Object, one needs two IDs: the History ID and Object ID within this history. Each Object's ObjectHistory contains all the versions of this Object, with the "live" version corresponding to the index (m_nCurrentIndexPlus1 - 1). The 0 value of m_nCurrentIndexPlus1 means that this ObjectHistory refers to the state before the Object has been created. If there are Redo states (i.e. there were one or more Undo executed on this Object and the Redo Delta-s were not yet discarded), then m_nCurrentIndexPlus1 is less than the size of m_aDeltaObjectVec and Redo operations are possible. In particular, the 0 index in an Object's ObjectHistory::m_aDeltaObjectVec is the Object at its time of creation, the larger indices correspond to changes to the Object, and the final index can be NULL meaning the Object has been deleted at that index's Delta.

Another important point, which permits safe use of Object pointers within WSM, is that the pointer to the current state of an Object never changes after this object is first created. When the active version of an Object is rolled back (by Undo) or forward (Redo), the contents of the previous or next version of this object is swapped with the Object instance pointed by the never changing Object*, so, all other objects not affected by these changes still hold on to the same pointer. As a result, the validity of the model is maintained without the overhead of converting between persistent IDs and changing pointers, and the only overhead involved is Object data swapping during Undo/Redo.

Importing and Exporting WSM Models

WSM supports serialization to the internal .wsm file format. It also supports the following formats:

  • Import/Export STL and OBJ
  • Import AXM (FormIt)
  • Export SAT
  • Kernel support for import of:
    • SKP (SketchUp)
    • Revit Families
    • SAT
  • Support for RVT (Revit) Export

![History_diagram.png]: (resources/History_diagram.png) "Data structure within a single history stream"