Skip to main content

Three.js Entities

Entities for 3D model management, customization, and visualization using Three.js.

ThreeJsModel

Purpose: Base 3D model entity for boats, rods, reels, and equipment.

Key Fields:

  • Id (int): Unique identifier
  • ModelType: Boat, Rod, Reel, Equipment, etc.
  • ModelName: Model name
  • ModelUrl: URL to GLTF/GLB file
  • ModelData: Embedded JSON or Base64 data
  • ReferenceLength, ReferenceWidth, ReferenceHeight: Reference dimensions at scale 1.0
  • ReferenceDiameter: Reference diameter (for cylindrical models)
  • AnchorPoint: Model origin location
  • DefaultRotationX, DefaultRotationY, DefaultRotationZ: Default rotations
  • DefaultScale: Default scale
  • Author: Model author
  • License: Model license
  • Version: Model version
  • PreviewImageUrl: Preview image
  • Complexity: Model complexity metrics

Relationships:

  • One-to-many: ModelVariant, ModelTexture, RodModel, ReelModel, EquipmentModel

Usage Patterns:

// Get models by type
var rodModels = context.ThreeJsModels
.Where(tm => tm.ModelType == ModelType.Rod)
.ToList();

ModelVariant

Purpose: Pre-defined variants of a base model (different sizes).

Key Fields:

  • Id (int): Unique identifier
  • ThreeJsModelId: Base model
  • VariantName: Variant name
  • Length, Width, Height: Variant dimensions
  • ScaleX, ScaleY, ScaleZ: Calculated scale factors
  • ModelUrl: Variant-specific model URL (optional)

Relationships:

  • Many-to-one: ThreeJsModel

UserModelCustomization

Purpose: User-specific model customizations.

Key Fields:

  • Id (int): Unique identifier
  • UserId: Customizing user
  • ThreeJsModelId: Base model
  • ModelVariantId: Selected variant (optional)
  • CustomLength, CustomWidth, CustomHeight: User's actual dimensions
  • ScaleX, ScaleY, ScaleZ: Calculated scale factors
  • RotationX, RotationY, RotationZ: Custom rotations
  • PositionOffsetX, PositionOffsetY, PositionOffsetZ: Position offsets
  • MaterialOverrides: Material/color overrides (JSON)

Relationships:

  • Many-to-one: User, ThreeJsModel, ModelVariant (optional)

RodModel

Purpose: Links rods to their 3D models.

Key Fields:

  • Id (int): Unique identifier
  • RodId: Specific rod (optional)
  • RodTypeId: Rod type (optional)
  • ThreeJsModelId: Associated model
  • DefaultLength: Default length for rod type
  • Configuration: Additional configuration (JSON)

Relationships:

  • Many-to-one: Rod (optional), RodType (optional), ThreeJsModel

ReelModel

Purpose: Links reels to their 3D models.

Key Fields:

  • Id (int): Unique identifier
  • ReelId: Specific reel (optional)
  • ReelTypeId: Reel type (optional)
  • ThreeJsModelId: Associated model
  • DefaultSize: Default size for reel type

Relationships:

  • Many-to-one: Reel (optional), ReelType (optional), ThreeJsModel

EquipmentModel

Purpose: Links boat equipment to 3D models.

Key Fields:

  • Id (int): Unique identifier
  • BoatEquipmentId: Specific equipment (optional)
  • BoatEquipmentTypeId: Equipment type (optional)
  • ThreeJsModelId: Associated model
  • DefaultSize: Default size for equipment type

Relationships:

  • Many-to-one: BoatEquipment (optional), BoatEquipmentType (optional), ThreeJsModel

ModelTexture

Purpose: Textures for 3D models.

Key Fields:

  • Id (int): Unique identifier
  • ThreeJsModelId: Associated model
  • TextureType: Diffuse, Normal, Specular, etc.
  • TextureUrl: Texture URL
  • TextureData: Embedded texture data

Relationships:

  • Many-to-one: ThreeJsModel