commit 5c9d4c52f966e38677f5ce7306dfd9e7bd53095a Author: Vinson Date: Fri Oct 9 12:42:49 2026 -0400 init diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f28239b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +charset = utf-8 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0af181c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Godot 4+ specific ignores +.godot/ +/android/ diff --git a/3DView/World.tscn b/3DView/World.tscn new file mode 100644 index 0000000..1c2eb6c --- /dev/null +++ b/3DView/World.tscn @@ -0,0 +1,34 @@ +[gd_scene format=3 uid="uid://nhxw3hmjwbq2"] + +[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_fxhyg"] +sky_horizon_color = Color(0.66224277, 0.6717428, 0.6867428, 1) +ground_horizon_color = Color(0.66224277, 0.6717428, 0.6867428, 1) + +[sub_resource type="Sky" id="Sky_u7r2g"] +sky_material = SubResource("ProceduralSkyMaterial_fxhyg") + +[sub_resource type="Environment" id="Environment_rvgr3"] +background_mode = 2 +sky = SubResource("Sky_u7r2g") +glow_enabled = true + +[node name="World" type="Node3D" unique_id=972927653] + +[node name="Camera3D" type="Camera3D" parent="." unique_id=1318868351] +transform = Transform3D(0.70710677, -0.49999997, 0.49999997, 0, 0.70710677, 0.70710677, -0.70710677, -0.49999997, 0.49999997, 3, 3, 3) + +[node name="env" type="Node3D" parent="." unique_id=1604780316] + +[node name="WorldEnvironment" type="WorldEnvironment" parent="env" unique_id=2007643215] +environment = SubResource("Environment_rvgr3") + +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="env" unique_id=1126070702] +transform = Transform3D(-0.8660254, -0.43301278, 0.25, 0, 0.49999997, 0.86602545, -0.50000006, 0.75, -0.43301266, 0, 0, 0) +shadow_enabled = true + +[node name="Model" type="Node3D" parent="." unique_id=1422642692] + +[node name="CSGBox3D" type="CSGBox3D" parent="Model" unique_id=759514053] + +[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Model/CSGBox3D" unique_id=1345411709] +operation = 2 diff --git a/Editor/Globals.gd b/Editor/Globals.gd new file mode 100644 index 0000000..6783240 --- /dev/null +++ b/Editor/Globals.gd @@ -0,0 +1,8 @@ +extends Node + +var object: TreeItem +var tree: Tree +var recent_files: Array[String] = ["C:\\test.gdcproj"] + +func open_project(path: String) -> void: + print("Opening project ", path) diff --git a/Editor/Globals.gd.uid b/Editor/Globals.gd.uid new file mode 100644 index 0000000..13bbfad --- /dev/null +++ b/Editor/Globals.gd.uid @@ -0,0 +1 @@ +uid://dpgyt7xykivqn diff --git a/Editor/Menus/3D Model.scn b/Editor/Menus/3D Model.scn new file mode 100644 index 0000000..27b6318 Binary files /dev/null and b/Editor/Menus/3D Model.scn differ diff --git a/Editor/Menus/Sketch.scn b/Editor/Menus/Sketch.scn new file mode 100644 index 0000000..05af657 Binary files /dev/null and b/Editor/Menus/Sketch.scn differ diff --git a/Editor/fileDropdown.gd b/Editor/fileDropdown.gd new file mode 100644 index 0000000..edbf76c --- /dev/null +++ b/Editor/fileDropdown.gd @@ -0,0 +1,28 @@ +extends MenuButton + +@onready var submenu = $"Open recent" + +func _ready() -> void: + var popup = self.get_popup() + popup.id_pressed.connect(_handle_popup) + popup.add_item("New") + popup.add_separator() + popup.add_item("Open") + submenu.get_parent().remove_child(submenu) + popup.add_submenu_node_item("Open recent", submenu, 3) + submenu.id_pressed.connect(_open_recent) + for file in CAD.recent_files: + var id = submenu.item_count + submenu.add_item(file.get_file().get_basename(), id) + submenu.set_item_metadata(id, file) + popup.add_separator() + popup.add_item("Save") + +func _open_recent(id: int): + CAD.open_project(submenu.get_item_metadata(id)) + +func _handle_popup(id: int) -> void: + var bname = self.get_popup().get_item_text(id) + if $content.has_node(bname): + var node = $content.get_node(bname) + node.visible=true diff --git a/Editor/fileDropdown.gd.uid b/Editor/fileDropdown.gd.uid new file mode 100644 index 0000000..24fabdb --- /dev/null +++ b/Editor/fileDropdown.gd.uid @@ -0,0 +1 @@ +uid://cq208q8osxfps diff --git a/Editor/objectTree.gd b/Editor/objectTree.gd new file mode 100644 index 0000000..4538b94 --- /dev/null +++ b/Editor/objectTree.gd @@ -0,0 +1,4 @@ +extends Tree + +func _ready() -> void: + CAD.tree=self diff --git a/Editor/objectTree.gd.uid b/Editor/objectTree.gd.uid new file mode 100644 index 0000000..22a91a2 --- /dev/null +++ b/Editor/objectTree.gd.uid @@ -0,0 +1 @@ +uid://c2g5lanlwbhhn diff --git a/Editor/topMenu.gd b/Editor/topMenu.gd new file mode 100644 index 0000000..bdcb756 --- /dev/null +++ b/Editor/topMenu.gd @@ -0,0 +1,18 @@ +extends TabBar + +var last_tab = "3D Model" +@onready var items = $"../VSplitContainer/TopBar" + +func _ready() -> void: + self.tab_changed.connect(_switch_tab) + +func _switch_tab(idx: int) -> void: + if items.has_node(last_tab): + items.get_node(last_tab).visible=false + + if idx!=-1: + last_tab = self.get_tab_title(idx) + if items.has_node(last_tab): + items.get_node(last_tab).visible=true + else: + last_tab="null" diff --git a/Editor/topMenu.gd.uid b/Editor/topMenu.gd.uid new file mode 100644 index 0000000..65f8980 --- /dev/null +++ b/Editor/topMenu.gd.uid @@ -0,0 +1 @@ +uid://dk17djhxpwle5 diff --git a/Icons/GuiDown.svg b/Icons/GuiDown.svg new file mode 100644 index 0000000..e64452b --- /dev/null +++ b/Icons/GuiDown.svg @@ -0,0 +1 @@ + diff --git a/Icons/GuiDown.svg.import b/Icons/GuiDown.svg.import new file mode 100644 index 0000000..2536a2e --- /dev/null +++ b/Icons/GuiDown.svg.import @@ -0,0 +1,46 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cl2mkufpygluu" +path="res://.godot/imported/GuiDown.svg-c7b85823e97448572e320ffff57aef9f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Icons/GuiDown.svg" +dest_files=["res://.godot/imported/GuiDown.svg-c7b85823e97448572e320ffff57aef9f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/high_quality_mode=0 +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +mipmaps/preserve_alpha_test_coverage=false +mipmaps/alpha_test_threshold=0.5 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/Icons/GuiUp.svg b/Icons/GuiUp.svg new file mode 100644 index 0000000..1c7be3d --- /dev/null +++ b/Icons/GuiUp.svg @@ -0,0 +1 @@ + diff --git a/Icons/GuiUp.svg.import b/Icons/GuiUp.svg.import new file mode 100644 index 0000000..966e201 --- /dev/null +++ b/Icons/GuiUp.svg.import @@ -0,0 +1,46 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://fdki8lt0331k" +path="res://.godot/imported/GuiUp.svg-2120459612ef170a2c13bb0af1b5b063.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Icons/GuiUp.svg" +dest_files=["res://.godot/imported/GuiUp.svg-2120459612ef170a2c13bb0af1b5b063.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/high_quality_mode=0 +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +mipmaps/preserve_alpha_test_coverage=false +mipmaps/alpha_test_threshold=0.5 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/Main.tscn b/Main.tscn new file mode 100644 index 0000000..9d74883 --- /dev/null +++ b/Main.tscn @@ -0,0 +1,130 @@ +[gd_scene format=3 uid="uid://dmavx00f4lqfw"] + +[ext_resource type="PackedScene" uid="uid://nhxw3hmjwbq2" path="res://3DView/World.tscn" id="1_glv2v"] +[ext_resource type="Script" uid="uid://dk17djhxpwle5" path="res://Editor/topMenu.gd" id="2_uu6xs"] +[ext_resource type="Script" uid="uid://cq208q8osxfps" path="res://Editor/fileDropdown.gd" id="3_3dxm6"] +[ext_resource type="Script" uid="uid://c2g5lanlwbhhn" path="res://Editor/objectTree.gd" id="3_fos0i"] +[ext_resource type="Theme" uid="uid://buglfq838gg6d" path="res://Themes/dark.tres" id="4_cm0pq"] +[ext_resource type="PackedScene" uid="uid://5ohq3v60rcyy" path="res://Editor/Menus/3D Model.scn" id="5_lgr22"] +[ext_resource type="PackedScene" uid="uid://cd6g4id4kvxjn" path="res://Editor/Menus/Sketch.scn" id="5_trn2v"] + +[node name="Main" type="ColorRect" unique_id=625404952] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0.359375, 0.359375, 0.359375, 1) + +[node name="TabMenuBar" type="TabBar" parent="." unique_id=1443854663] +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.05 +anchor_right = 1.0 +anchor_bottom = 0.03 +current_tab = 0 +tab_count = 2 +tab_0/title = "3D Model" +tab_1/title = "Sketch" +script = ExtResource("2_uu6xs") + +[node name="ColorRect" type="ColorRect" parent="." unique_id=2055027201] +layout_mode = 1 +anchors_preset = -1 +anchor_right = 0.05 +anchor_bottom = 0.03 +theme = ExtResource("4_cm0pq") +color = Color(1, 0.6440388, 0.08436966, 1) + +[node name="File" type="MenuButton" parent="ColorRect" unique_id=270412094] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("4_cm0pq") +text = "File" +script = ExtResource("3_3dxm6") + +[node name="Open recent" type="PopupMenu" parent="ColorRect/File" unique_id=1254102426] +allow_search = false + +[node name="content" type="Control" parent="ColorRect/File" unique_id=1678584665] +layout_mode = 1 +anchors_preset = 0 + +[node name="Open" type="FileDialog" parent="ColorRect/File/content" unique_id=1743232794] +oversampling_override = 1.0 +initial_position = 2 +minimize_disabled = false +maximize_disabled = false +file_mode = 0 +access = 2 +filters = PackedStringArray("*.gdcproj") + +[node name="New" type="FileDialog" parent="ColorRect/File/content" unique_id=878982016] +oversampling_override = 1.0 +initial_position = 2 +minimize_disabled = false +maximize_disabled = false +access = 2 + +[node name="Save" type="FileDialog" parent="ColorRect/File/content" unique_id=381442236] +initial_position = 2 +access = 2 + +[node name="VSplitContainer" type="VSplitContainer" parent="." unique_id=242325644] +propagate_maximum_size = false +layout_mode = 1 +anchors_preset = -1 +anchor_top = 0.03 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +split_offsets = PackedInt32Array(80) +split_offset = 80 + +[node name="TopBar" type="ColorRect" parent="VSplitContainer" unique_id=2020004783] +layout_mode = 2 +color = Color(0.328125, 0.328125, 0.328125, 1) + +[node name="3D Model" parent="VSplitContainer/TopBar" unique_id=1492985122 instance=ExtResource("5_lgr22")] +layout_mode = 1 + +[node name="Sketch" parent="VSplitContainer/TopBar" unique_id=1465816757 instance=ExtResource("5_trn2v")] +visible = false +layout_mode = 1 + +[node name="HSplitContainer" type="HSplitContainer" parent="VSplitContainer" unique_id=2052818868] +layout_mode = 2 +split_offsets = PackedInt32Array(200) +split_offset = 200 + +[node name="ColorRect" type="ColorRect" parent="VSplitContainer/HSplitContainer" unique_id=373847234] +layout_mode = 2 +color = Color(0.4375, 0.4375, 0.4375, 1) + +[node name="Tree" type="Tree" parent="VSplitContainer/HSplitContainer/ColorRect" unique_id=461316319] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("3_fos0i") + +[node name="SubViewportContainer" type="SubViewportContainer" parent="VSplitContainer/HSplitContainer" unique_id=1578114498] +layout_mode = 2 +size_flags_horizontal = 17 +size_flags_vertical = 17 +stretch = true +mouse_target = true + +[node name="Viewport" type="SubViewport" parent="VSplitContainer/HSplitContainer/SubViewportContainer" unique_id=1307677926] +handle_input_locally = false +size = Vector2i(1708, 955) +render_target_update_mode = 4 + +[node name="World" parent="VSplitContainer/HSplitContainer/SubViewportContainer/Viewport" unique_id=972927653 instance=ExtResource("1_glv2v")] diff --git a/Model/object3D.gd b/Model/object3D.gd new file mode 100644 index 0000000..f878123 --- /dev/null +++ b/Model/object3D.gd @@ -0,0 +1,2 @@ +extends Node3D +class_name Object3D diff --git a/Model/object3D.gd.uid b/Model/object3D.gd.uid new file mode 100644 index 0000000..4109e54 --- /dev/null +++ b/Model/object3D.gd.uid @@ -0,0 +1 @@ +uid://deqnssc88a3mp diff --git a/Themes/dark.tres b/Themes/dark.tres new file mode 100644 index 0000000..2a9ad34 --- /dev/null +++ b/Themes/dark.tres @@ -0,0 +1,3 @@ +[gd_resource type="Theme" format=3 uid="uid://buglfq838gg6d"] + +[resource] diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..c6bbb7d --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..9039f73 --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,46 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bm7g6hl5vmqf1" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/high_quality_mode=0 +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +mipmaps/preserve_alpha_test_coverage=false +mipmaps/alpha_test_threshold=0.5 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..37244d0 --- /dev/null +++ b/project.godot @@ -0,0 +1,46 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="GCAD" +run/main_scene="uid://dmavx00f4lqfw" +config/use_custom_user_dir=true +config/custom_user_dir_name="Astronand/gcad" +config/features=PackedStringArray("4.8", "Forward Plus") +config/icon="res://icon.svg" + +[autoload] + +CAD="*uid://dpgyt7xykivqn" + +[display] + +window/size/viewport_width=1920 +window/size/viewport_height=1080 +window/stretch/mode="canvas_items" +window/stretch/aspect="expand" + +[gui] + +common/auto_focus_strategy=1 + +[input_devices] + +joypads/ignore_joypad_on_unfocused_application=true + +[physics] + +3d/physics_engine="Jolt Physics" + +[rendering] + +rendering_device/driver.windows="d3d12" +lights_and_shadows/multi_bounce_occlusion/enabled=true