Feature issue4 transparent menu#550
Conversation
KREA için başlangıç sürümü 0.1.0
…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
There was a problem hiding this comment.
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.
| // 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 |
There was a problem hiding this comment.
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.
| // Simplified: return a placeholder since THREE.js is not available | ||
| console.log('CreateMaterial called - THREE.js functionality removed'); | ||
| return {}; // Placeholder |
There was a problem hiding this comment.
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.
| // Simplified: return a placeholder since THREE.js is not available | ||
| console.log('CreateLineFromPoints called - THREE.js functionality removed'); | ||
| return {}; // Placeholder |
There was a problem hiding this comment.
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.
| { | ||
| this.intersection = null; | ||
| this.markerObject = new THREE.Object3D (); | ||
| this.markerObject = {}; // Placeholder object |
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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.
|
|
||
| // Export vertices as CARTESIAN_POINTs | ||
| vertices.forEach (vertex => { | ||
| stepWriter.WriteLine (`#${vertex.id} = CARTESIAN_POINT('',({vertex.coord.x},{vertex.coord.y},{vertex.coord.z}));`); |
There was a problem hiding this comment.
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}));
| 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}));`); |
| 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)); |
There was a problem hiding this comment.
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.
| 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)); |
| v2: startIndex + face[2], | ||
| SetMaterial: function(mat) { this.mat = mat; }, | ||
| GetMaterial: function() { return this.mat; } |
There was a problem hiding this comment.
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.
| v2: startIndex + face[2], | |
| SetMaterial: function(mat) { this.mat = mat; }, | |
| GetMaterial: function() { return this.mat; } | |
| v2: startIndex + face[2] |
| } else if (!enable && this.cameraSpotLight) { | ||
| this.scene.remove(this.cameraSpotLight.target); | ||
| this.scene.remove(this.cameraSpotLight); | ||
| this.cameraSpotLight.dispose && this.cameraSpotLight.dispose(); |
There was a problem hiding this comment.
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.
| this.cameraSpotLight.dispose && this.cameraSpotLight.dispose(); |
| <meta name="viewport" content="width=device-width, user-scalable=no"> | ||
|
|
||
| <title>Online 3D Viewer</title> | ||
| <title>KREACAd</title> |
There was a problem hiding this comment.
Inconsistent capitalization of 'KreaCAD'. Should be 'KreaCAD' to match the branding used elsewhere (package.json line 2, README.md line 1).
| <title>KREACAd</title> | |
| <title>KreaCAD</title> |
No description provided.