Skip to content

editorGlobalsAssemblingScoreEvaluator

Class: AssemblingScoreEvaluator

Helper class to evaluate and score AssemblingStates and CombineOperations.

Hierarchy

  • AssemblingScoreEvaluator

Index

Properties

Methods

Properties

Static Private localAABB2DCache

localAABB2DCache: Map‹SvgSurfaceDescriptor‹›, AABB2D‹›› = new Map()

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:24


Static Private localJointCenterPointCache

localJointCenterPointCache: Map‹string, Vector2‹›› = new Map()

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:25

Methods

Static Private _compareRelativeToPlate

_compareRelativeToPlate(pointsA: Vector2[], pointsB: Vector2[], a: IAssemblingSvgSurface, b: IAssemblingSvgSurface, root: IAssemblingSvgSurface, rootCenterPoints: Vector2[]): number

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:230

Parameters:

Name Type
pointsA Vector2[]
pointsB Vector2[]
a IAssemblingSvgSurface
b IAssemblingSvgSurface
root IAssemblingSvgSurface
rootCenterPoints Vector2[]

Returns: number


Static Private _getGlobalAABB

_getGlobalAABB(surface: IAssemblingSvgSurface): AABB

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:284

Parameters:

Name Type
surface IAssemblingSvgSurface

Returns: AABB


Static Private _getGlobalOBB

_getGlobalOBB(surface: IAssemblingSvgSurface): OBB

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:313

Parameters:

Name Type
surface IAssemblingSvgSurface

Returns: OBB


Static Private _getLocalAABB2D

_getLocalAABB2D(surface: IAssemblingSvgSurface): AABB2D

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:272

Parameters:

Name Type
surface IAssemblingSvgSurface

Returns: AABB2D


Static Private _getLocalAABB3D

_getLocalAABB3D(surface: IAssemblingSvgSurface): AABB

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:293

Parameters:

Name Type
surface IAssemblingSvgSurface

Returns: AABB


Static Private _getLocalJointCenterPoint

_getLocalJointCenterPoint(joint: Joint‹AtomicPattern›): Vector2

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:302

Parameters:

Name Type
joint Joint‹AtomicPattern›

Returns: Vector2


Static Private _symmetryAlignmentScore

_symmetryAlignmentScore(group: SymmetryGroup, plate: IAssemblingSvgSurface): number

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:190

Parameters:

Name Type
group SymmetryGroup
plate IAssemblingSvgSurface

Returns: number


Static calculateSymmetricPlateCountScore

calculateSymmetricPlateCountScore(__namedParameters: object): number

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:156

Given a Match, score how well these two joints fit together, based on their symmetries and clusters. Rough idea: The size of the symmetry (2 for reflective, more for rotational) needs to match with the copy amount of the other plate. This method is symmetrical.

Parameters:

__namedParameters: object

Name Type
a IJointPlacement
b IJointPlacement

Returns: number


Static collisionScore

collisionScore(assembly: IAssemblingSvgSurface[]): number

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:80

Parameters:

Name Type
assembly IAssemblingSvgSurface[]

Returns: number


Static compactness

compactness(assembly: IAssemblingSvgSurface[]): number

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:67

Parameters:

Name Type
assembly IAssemblingSvgSurface[]

Returns: number


Static getSymmetryScore

getSymmetryScore(symmetry: SymmetryGroup, plate: IAssemblingSvgSurface): number

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:120

Calculate the score of a symmetry, based on the connections its joints have. Basically a symmetry gets a good score when it is filled with mostly the same plates, and there are enough available for the remaining open slots.

Parameters:

Name Type
symmetry SymmetryGroup
plate IAssemblingSvgSurface

Returns: number


Static resetCaches

resetCaches(): void

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:27

Returns: void


Static scoreOperation

scoreOperation(operation: CombineOperation): number

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:105

Parameters:

Name Type
operation CombineOperation

Returns: number


Static scoreState

scoreState(state: AssemblingState): number

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:33

Scores a given Assembling state. The returned value is in range 0-1

Parameters:

Name Type
state AssemblingState

Returns: number


Static usedJointsRatio

usedJointsRatio(assembly: IAssemblingSvgSurface[]): number

Defined in src/modules/kyub.core.plateImport/src/autoAssembly/AssemblingScoreEvaluator.ts:99

Parameters:

Name Type
assembly IAssemblingSvgSurface[]

Returns: number