Skip to content

Feature issue4 transparent menu#550

Open
tansuozcelebi wants to merge 28 commits intokovacsv:masterfrom
KREA-MAK:feature-issue4-transparent-menu
Open

Feature issue4 transparent menu#550
tansuozcelebi wants to merge 28 commits intokovacsv:masterfrom
KREA-MAK:feature-issue4-transparent-menu

Conversation

@tansuozcelebi
Copy link
Copy Markdown

No description provided.

tansuozcelebi and others added 28 commits September 28, 2025 09:11
…enellikle bir commit mesajı içermek için kullanılır. Bu dosya, yapılan değişikliklerin kısa bir açıklamasını yazmak için kullanılır. İşte bu dosyanın içeriği:
Added a note to ask Claude from Anthropic for better understanding.
Co-authored-by: tansuozcelebi <33808162+tansuozcelebi@users.noreply.github.com>
Co-authored-by: tansuozcelebi <33808162+tansuozcelebi@users.noreply.github.com>
Co-authored-by: tansuozcelebi <33808162+tansuozcelebi@users.noreply.github.com>
…-system

Add section view with 6-axis transform gizmo and clipping plane
Fix spacing in initTreeUI function definition
Copilot AI review requested due to automatic review settings January 11, 2026 16:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements multiple features and enhancements to rebrand the application from "Online 3D Viewer" to "KreaCAD," adds support for new file formats, removes THREE.js dependencies from measurement tools, and introduces various UI improvements including gradient backgrounds and primitives management.

Changes:

  • Rebranded application to KreaCAD with updated naming throughout the codebase
  • Added support for new file formats: STEP export, DXF, XYZ, STPZ, USDZ, and SVG import
  • Removed THREE.js functionality from measurement tools and replaced with placeholder implementations
  • Enhanced UI with gradient backgrounds, camera spotlight, and new CSS styling for toolbar and dialogs

Reviewed changes

Copilot reviewed 62 out of 443 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
source/website/measuretool.js Removed THREE.js dependency, replaced 3D functionality with console logging placeholders
source/website/index.js Removed iframe restriction, added PrimitivesManager export, updated intro text
source/website/exportdialog.js Added STEP export format option
source/website/css/*.css Updated theme variables from "ov" to "kreacad" prefix, added new styling for primitives, version labels, and material dropdowns
source/engine/viewer/*.js Added gradient background and camera spotlight features
source/engine/import/*.js Added new importers for XYZ, USDZ, DXF, and STPZ formats
source/engine/export/exporterstep.js Implemented new STEP file exporter
sandbox/*.html Updated all sandbox page titles to "KREACAd"
package.json Updated package name, description, scripts, and dependencies
index.html Added new root-level redirect page
README.md Updated with KreaCAD branding and company information

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +12 to +14
// Simplified: return a default normal since THREE.js is not available
console.log('GetFaceWorldNormal called - THREE.js functionality removed');
return { x: 0, y: 0, z: 1 }; // Default normal
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning a hardcoded normal vector breaks the measurement tool functionality. This function is still called by other parts of the codebase (line 78) that expect actual normal calculations. Either restore the THREE.js dependency for this module or implement proper normal calculation without THREE.js.

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +21
// Simplified: return a placeholder since THREE.js is not available
console.log('CreateMaterial called - THREE.js functionality removed');
return {}; // Placeholder
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning an empty object breaks material creation. The returned placeholder object is incompatible with THREE.js Line constructor expectations used in CreateLineFromPoints and throughout the marker visualization system.

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +28
// Simplified: return a placeholder since THREE.js is not available
console.log('CreateLineFromPoints called - THREE.js functionality removed');
return {}; // Placeholder
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning an empty object instead of a THREE.Line breaks the marker object hierarchy. The Marker class adds these return values to markerObject (line 38-42 in original code), which will fail without proper THREE.js objects.

Copilot uses AI. Check for mistakes.
{
this.intersection = null;
this.markerObject = new THREE.Object3D ();
this.markerObject = {}; // Placeholder object
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replacing THREE.Object3D with an empty object breaks the marker's 3D scene integration. This object needs to support methods like add(), which are called in the original implementation and likely in other parts of the viewer.

Copilot uses AI. Check for mistakes.
Comment on lines +81 to +86
if (aIntersection.point && bIntersection.point && aIntersection.point.distanceTo) {
result.pointsDistance = aIntersection.point.distanceTo (bIntersection.point);
}
// Angle calculation simplified
result.facesAngle = 0; // Default angle
result.parallelFacesDistance = null; // Not calculated without THREE.js
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The simplified calculation always returns angle as 0 and parallelFacesDistance as null, making angle and parallel distance measurements non-functional. This breaks a core feature of the measurement tool.

Copilot uses AI. Check for mistakes.

// Export vertices as CARTESIAN_POINTs
vertices.forEach (vertex => {
stepWriter.WriteLine (`#${vertex.id} = CARTESIAN_POINT('',({vertex.coord.x},{vertex.coord.y},{vertex.coord.z}));`);
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Template literal syntax is incorrect. The curly braces inside the parentheses are treated as literal characters, not variable interpolation. Should be: #${vertex.id} = CARTESIAN_POINT('',(${vertex.coord.x},${vertex.coord.y},${vertex.coord.z}));

Suggested change
stepWriter.WriteLine (`#${vertex.id} = CARTESIAN_POINT('',({vertex.coord.x},{vertex.coord.y},{vertex.coord.z}));`);
stepWriter.WriteLine (`#${vertex.id} = CARTESIAN_POINT('',(${vertex.coord.x},${vertex.coord.y},${vertex.coord.z}));`);

Copilot uses AI. Check for mistakes.
Comment on lines +148 to +160
let height = start.DistanceTo (end);
let radius = 0.01; // Very thin line

// Add vertices for cylinder
let startIndex = mesh.VertexCount ();

for (let i = 0; i <= segments; i++) {
let angle = (i / segments) * 2 * Math.PI;
let x = Math.cos (angle) * radius;
let y = Math.sin (angle) * radius;

mesh.AddVertex (new Coord3D (start.x + x, start.y + y, start.z));
mesh.AddVertex (new Coord3D (end.x + x, end.y + y, end.z + height));
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The height variable represents distance but is being added to the z-coordinate without proper vector transformation. Line geometry should be oriented along the actual line direction from start to end, not always along the Z-axis.

Suggested change
let height = start.DistanceTo (end);
let radius = 0.01; // Very thin line
// Add vertices for cylinder
let startIndex = mesh.VertexCount ();
for (let i = 0; i <= segments; i++) {
let angle = (i / segments) * 2 * Math.PI;
let x = Math.cos (angle) * radius;
let y = Math.sin (angle) * radius;
mesh.AddVertex (new Coord3D (start.x + x, start.y + y, start.z));
mesh.AddVertex (new Coord3D (end.x + x, end.y + y, end.z + height));
let length = start.DistanceTo (end);
let radius = 0.01; // Very thin line
if (length === 0) {
return;
}
// Compute direction from start to end and an orthonormal basis
let dirX = (end.x - start.x) / length;
let dirY = (end.y - start.y) / length;
let dirZ = (end.z - start.z) / length;
// Choose an arbitrary vector not parallel to dir to build a perpendicular basis
let arbX = 0.0;
let arbY = 0.0;
let arbZ = 1.0;
if (Math.abs (dirZ) > 0.999) {
arbY = 1.0;
arbZ = 0.0;
}
// u = normalize(cross(dir, arb))
let ux = dirY * arbZ - dirZ * arbY;
let uy = dirZ * arbX - dirX * arbZ;
let uz = dirX * arbY - dirY * arbX;
let uLen = Math.sqrt (ux * ux + uy * uy + uz * uz);
if (uLen === 0) {
// Fallback: no valid perpendicular, should be extremely rare
return;
}
ux /= uLen;
uy /= uLen;
uz /= uLen;
// v = cross(dir, u)
let vx = dirY * uz - dirZ * uy;
let vy = dirZ * ux - dirX * uz;
let vz = dirX * uy - dirY * ux;
// Add vertices for cylinder aligned with the actual line direction
let startIndex = mesh.VertexCount ();
for (let i = 0; i <= segments; i++) {
let angle = (i / segments) * 2 * Math.PI;
let cosA = Math.cos (angle);
let sinA = Math.sin (angle);
// offset = radius * (cosA * u + sinA * v)
let offX = radius * (cosA * ux + sinA * vx);
let offY = radius * (cosA * uy + sinA * vy);
let offZ = radius * (cosA * uz + sinA * vz);
mesh.AddVertex (new Coord3D (start.x + offX, start.y + offY, start.z + offZ));
mesh.AddVertex (new Coord3D (end.x + offX, end.y + offY, end.z + offZ));

Copilot uses AI. Check for mistakes.
Comment on lines +128 to +130
v2: startIndex + face[2],
SetMaterial: function(mat) { this.mat = mat; },
GetMaterial: function() { return this.mat; }
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triangle objects with inline SetMaterial/GetMaterial methods are inconsistent with the expected Triangle API. The mesh.AddTriangle method likely expects a proper Triangle object or different parameters, not a plain object with methods.

Suggested change
v2: startIndex + face[2],
SetMaterial: function(mat) { this.mat = mat; },
GetMaterial: function() { return this.mat; }
v2: startIndex + face[2]

Copilot uses AI. Check for mistakes.
} else if (!enable && this.cameraSpotLight) {
this.scene.remove(this.cameraSpotLight.target);
this.scene.remove(this.cameraSpotLight);
this.cameraSpotLight.dispose && this.cameraSpotLight.dispose();
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking for dispose method existence before calling is good defensive programming, but SpotLight objects in THREE.js don't have a dispose method. Consider removing this line or documenting why it's needed.

Suggested change
this.cameraSpotLight.dispose && this.cameraSpotLight.dispose();

Copilot uses AI. Check for mistakes.
<meta name="viewport" content="width=device-width, user-scalable=no">

<title>Online 3D Viewer</title>
<title>KREACAd</title>
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent capitalization of 'KreaCAD'. Should be 'KreaCAD' to match the branding used elsewhere (package.json line 2, README.md line 1).

Suggested change
<title>KREACAd</title>
<title>KreaCAD</title>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants