Skip to content

donutAnees/CAD-Visualizer-Tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAD Visualizer Tool

A CAD editor built using OpenGL and Win32.

CAD Visualizer Tool – Features Overview

Core Features

3D Scene Editor

  • Create, select, transform and delete 3D objects in real-time object.
  • Object properties panel.
image

Rendering

  • Grid rendering on the XZ plane for scene orientation.
  • Bounding box and vertex visualization for selected objects.
  • Object list with selection and delete functionality.
  • Dialog for creating new objects with type and parameters.

Camera Controls

  • Free-look camera: WASD movement and mouse look.
  • Provides Orthographic and Perspective Views.
  • Orbit camera: rotate around a target, zoom in/out.
  • Seamless switching between camera modes.

Orthographic View

image

Perspective View

image

File I/O

  • Import 3D models from STL files.
  • Support for both binary and ASCII STL formats.

Modular MVC (Model-View-Controller) design for maintainability.

Technical Functionality

Geometry & 3D Modeling

Parametric Primitives

The engine supports mathematically defined primitives (cube, sphere, cylinder, torus, cone, plane, pyramid) with fully editable parameters and transform operations.

Face-Level Selection

Each mesh contains a list of triangular faces, each defined by:

  • 3 vertex positions
  • Precomputed normal
  • Per-face AABB bounds

This enables precise selection and ray-intersection down to the triangle level.

Multi-Mode Bounding Volumes

  • Object-Space AABB: Original dimensions before transforms
  • Scaled Bounds: Size after applying scale factors
  • Tight Bounds (Scale Only): Pre-rotation bounding box
  • World-Space AABB: Full transformation applied

Bounding Volume Hierarchy (BVH)

A memory-optimized BVH implementation provides fast ray queries and intersection testing.

Key features:

  • SAH (Surface Area Heuristic): Optimal split evaluation
  • In-place triangle sorting: Improves cache locality
  • O(n) SAH evaluation: Using precomputed left/right surface area arrays

KD-Tree Accelerator

Optimized for balanced space partitioning.

Key Features

  • Axis cycling (X → Y → Z)
  • Median-based splitting
  • Triangle overlap handling
  • Non-recursive stack traversal

Ray-AABB Rejection

The engine performs fast AABB tests before expensive triangle checks.
This rejects over 90% of rays early.

Möller–Trumbore Triangle Intersection

The engine implements a high-precision triangle intersection method for face and object selection.

Note:
This application is written in C++14, uses OpenGL for rendering, and the Win32 API for its user interface.

About

OpenGl implementation for Windows CAD Software

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors