OpenCascade.js
API ReferenceModelingAlgorithmsTKShHealing

ShapeProcess

OCCT package ShapeProcess: ShapeProcess, ShapeProcess_Context, ShapeProcess_Operator, ShapeProcess_OperLibrary, and 2 more bound classes.

ShapeProcess

Shape Processing module allows to define and apply general Shape Processing as a customizable sequence of Shape Healing operators. The customization is implemented via user-editable resource file which defines sequence of operators to be executed and their parameters.

Constructors(1)

Static methods(5)

  • RegisterOperator(name: string, op: ShapeProcess_Operator): boolean

    Registers operator to make it visible for Performer.

    Parameters (2)
    • name
    • op
  • FindOperator(name: string): { returnValue: boolean; op: ShapeProcess_Operator; [Symbol.dispose](): void }

    Finds operator by its name.

    Parameters (1)
    • name
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • op: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • Perform(context: ShapeProcess_Context, seq: string, theProgress: Message_ProgressRange): boolean

    Performs a specified sequence of operators on theContext.

    Parameters (3)
    • context
    • seq
    • theProgress
      Progress indicator.
    Returns

    true if at least one operation was performed, false otherwise.

  • Perform(theContext: ShapeProcess_Context, theOperations: any, theProgress: Message_ProgressRange): boolean

    Performs a specified sequence of operators on theContext.

    Parameters (3)
    • theContext
      Context to perform operations on. Contains the shape to process and processing parameters. If processing parameters are not set, default values are used. Parameters should be in a scope of operation, for example, instead of "FromSTEP.FixShape.Tolerance3d" we should use just "FixShape.Tolerance3d".
    • theOperations
      Bitset of operations to perform.
    • theProgress
      Progress indicator.
    Returns

    true if at least one operation was performed, false otherwise.

  • ToOperationFlag(theName: string): [ShapeProcess_Operation, boolean]

    Converts operation name to operation flag.

    Parameters (1)
    • theName
      Operation name.
    Returns

    Operation flag and true if the operation name is valid, false otherwise.

ShapeProcess_Context

Provides convenient interface to resource file Allows to load resource file and get values of attributes starting from some scope, for example if scope is defined as "ToV4" and requested parameter is "exec.op", value of "ToV4.exec.op" parameter from the resource file will be returned.

Constructors(2)

Static methods(2)

Instance methods(16)

  • Loading Resource_Manager object if this object not equal internal static Resource_Manager object or internal static Resource_Manager object is null.

    Parameters (1)
    • file
  • Returns internal Resource_Manager object.

  • SetScope(scope: string): void

    Set a new (sub)scope.

    Parameters (1)
    • scope
  • UnSetScope(): void

    Go out of current scope.

  • IsParamSet(param: string): boolean

    Returns True if parameter is defined in the resource file.

    Parameters (1)
    • param
  • GetReal(param: string, val: number): { returnValue: boolean; val: number }
    Parameters (2)
    • param
    • val
  • GetInteger(param: string, val: number): { returnValue: boolean; val: number }
    Parameters (2)
    • param
    • val
  • GetBoolean(param: string, val: boolean): { returnValue: boolean; val: boolean }
    Parameters (2)
    • param
    • val
  • GetString(param: string, val: TCollection_AsciiString): boolean

    Get value of parameter as being of specific type Returns False if parameter is not defined or has a wrong type.

    Parameters (2)
    • param
    • val
      Mutated in place; read the updated value from this argument after the call.
  • RealVal(param: string, def: number): number
    Parameters (2)
    • param
    • def
  • IntegerVal(param: string, def: number): number
    Parameters (2)
    • param
    • def
  • BooleanVal(param: string, def: boolean): boolean
    Parameters (2)
    • param
    • def
  • StringVal(param: string, def: string): string

    Get value of parameter as being of specific type If parameter is not defined or does not have expected type, returns default value as specified.

    Parameters (2)
    • param
    • def
  • SetTraceLevel(tracelev: number): void

    Sets trace level used for outputting messages.

    • 0: no trace at all
    • 1: errors
    • 2: errors and warnings
    • 3: all messages Default is 1 : Errors traced
    Parameters (1)
    • tracelev
  • TraceLevel(): number

    Returns trace level used for outputting messages.

ShapeProcess_OperLibrary

Provides a set of following operators.
DirectFaces FixShape SameParameter SetTolerance SplitAngle BSplineRestriction ElementaryToRevolution SurfaceToBSpline ToBezier SplitContinuity SplitClosedFaces FixWireGaps FixFaceSize DropSmallEdges FixShape SplitClosedEdges

Constructors(1)

Static methods(2)

ShapeProcess_ShapeContext

Extends Context to handle shapes Contains map of shape-shape, and messages attached to shapes.

Constructors(2)

Static methods(2)

Instance methods(20)

ShapeProcess_UOperator

Defines operator as container for static function OperFunc. This allows user to create new operators without creation of new classes.

Constructors(1)

Static methods(2)

Instance methods(2)