Skip to content

Commit f8b23b1

Browse files
committed
feat: release edit api
1 parent 7f230d1 commit f8b23b1

File tree

151 files changed

+19617
-13923
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+19617
-13923
lines changed

index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,15 @@ <h3>Choose an example</h3>
2828
<a style="width: fit-content;" href="./packages\fragments\src\Importers\IfcImporter\examples\HelloWorldSchema\example.html">fragments/HelloWorldSchema</a>
2929
<a style="width: fit-content;" href="./packages\fragments\src\FragmentsModels\example.html">fragments/FragmentsModels</a>
3030
<a style="width: fit-content;" href="./packages\fragments\src\FragmentsModels\examples\VisibilityOperations\example.html">fragments/VisibilityOperations</a>
31+
<a style="width: fit-content;" href="./packages\fragments\src\FragmentsModels\examples\SteelDetailing\example.html">fragments/SteelDetailing</a>
32+
<a style="width: fit-content;" href="./packages\fragments\src\FragmentsModels\examples\Rebars\example.html">fragments/Rebars</a>
3133
<a style="width: fit-content;" href="./packages\fragments\src\FragmentsModels\examples\Raycasting\example.html">fragments/Raycasting</a>
3234
<a style="width: fit-content;" href="./packages\fragments\src\FragmentsModels\examples\ModelInformation\example.html">fragments/ModelInformation</a>
35+
<a style="width: fit-content;" href="./packages\fragments\src\FragmentsModels\examples\Materials\example.html">fragments/Materials</a>
36+
<a style="width: fit-content;" href="./packages\fragments\src\FragmentsModels\examples\EditProperties\example.html">fragments/EditProperties</a>
37+
<a style="width: fit-content;" href="./packages\fragments\src\FragmentsModels\examples\EditElements\example.html">fragments/EditElements</a>
38+
<a style="width: fit-content;" href="./packages\fragments\src\FragmentsModels\examples\EditApi\example.html">fragments/EditApi</a>
39+
<a style="width: fit-content;" href="./packages\fragments\src\FragmentsModels\examples\BuildingConfigurator\example.html">fragments/BuildingConfigurator</a>
3340

3441
</div>
3542
</body>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
66
"Juan Hoyos (https://github.com/HoyosJuan)"
77
],
8+
"private": true,
89
"scripts": {
910
"dev": "vite --host",
1011
"build-core": "yarn workspace @thatopen/fragments build",

packages/fragments/flatbuffers/index.fbs

Lines changed: 6 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ table Shell {
122122
big_profiles: [BigShellProfile] (required); // Exterior profiles of the shell (if the shell has more than 65535 points)
123123
big_holes: [BigShellHole] (required); // Holes of the shell (if the shell has more than 65535 points)
124124
type: ShellType; // Type of the shell (less than 65535 points or more than 65535 points)
125+
profiles_face_ids: [ushort] (required); // An array of face ids for the profiles
125126
}
126127

127128
table CircleExtrusion {
@@ -139,6 +140,11 @@ table Meshes {
139140
shells: [Shell] (required); // The list of geometries defined as faces and holes (breps).
140141
local_transforms: [Transform] (required); // Local transforms of the samples
141142
global_transforms: [Transform] (required); // A set of local transformations for geometry samples. Each global transformation is assigned to a local id by meshes_items.
143+
material_ids: [uint]; // An array of local ids for the materials
144+
representation_ids: [uint]; // An array of local ids for the representations
145+
sample_ids: [uint]; // An array of local ids for the samples
146+
local_transform_ids: [uint]; // An array of local ids for the local transforms
147+
global_transform_ids: [uint]; // An array of local ids for the global transforms
142148
}
143149

144150
table Attribute {
@@ -155,64 +161,6 @@ table SpatialStructure {
155161
children: [SpatialStructure]; // Child spatial nodes of the current spatial node
156162
}
157163

158-
table Alignment {
159-
absolute: [uint]; // Geometry representation ids for the absolute respresentation of this alignment
160-
horizontal: [uint]; // Geometry representation ids for the horizontal respresentation of this alignment
161-
vertical: [uint]; // Geometry representation ids for the vertical respresentation of this alignment
162-
}
163-
164-
// IMPLICIT GEOMETRIES
165-
// Implicit geometries' only goal is to create mesh representations
166-
// Implicit geometries main object are samples. Samples are made of:
167-
// - A representation (a common interface for all implicit geometries)
168-
// - A transform that defines the geometry's transformation
169-
// Not all samples are used to create mesh representations. For example, a wall
170-
// with some holes might be made using multiple samples, but in the end only the
171-
// end sample will be used to create the mesh representation.
172-
173-
enum GeometryClass:byte {
174-
NONE = 0, // No geometry class
175-
LINES = 1, // Simple lines geometry class
176-
ELLIPSE_ARC = 2, // Ellipse arc geometry class
177-
CLOTHOID = 3, // Clothoid geometry class
178-
PARABOLA = 4, // Parabola geometry class
179-
WALLS = 5, // Walls geometry class
180-
}
181-
182-
struct GeometrySample {
183-
id: uint; // The index of the geometry in the representations array
184-
transform: uint; // The index of the transform in transforms
185-
}
186-
187-
struct GeometryRepresentation {
188-
id: uint; // The index of the geometry in its corresponding array
189-
geometry_class: GeometryClass; // The class of the geometry
190-
}
191-
192-
table GeometryLines {
193-
points: [float] (required); // Points of the line
194-
}
195-
196-
struct GeometryWall {
197-
start: FloatVector; // Start point of the wall
198-
end: FloatVector; // End point of the wall
199-
height: float; // Height of the wall
200-
width: float; // Width of the wall
201-
offset: float; // Offset of the wall
202-
}
203-
204-
table Geometries {
205-
samples: [GeometrySample] (required); // An array of implicit geometry samples
206-
sample_ids: [uint]; // An array of ids for the implicit geometry samples
207-
representations: [GeometryRepresentation] (required); // An array of implicit geometry representations
208-
representation_ids: [uint]; // An array of ids for the implicit geometry representations
209-
transforms: [Transform] (required); // An array of implicit geometry transforms
210-
transform_ids: [uint]; // An array of ids for the implicit geometry transforms
211-
representations_samples: [uint]; // An array of id pairs that work as an indexation matching mesh representations ids with implicit samples ids
212-
lines: [GeometryLines] (required); // An array of implicit geometry lines
213-
walls: [GeometryWall]; // An array of implicit geometry walls
214-
}
215-
216164
// MODELS
217165

218166
// The main object and the entry point of all Fragment files. Each Fragments file has just one model, and it contains all the information of the file.
@@ -238,10 +186,6 @@ table Model {
238186

239187
spatial_structure: SpatialStructure; // A tree representing the spatial relation between elements.
240188

241-
alignments: [Alignment]; // A set of civil alignments for this model
242-
243-
geometries: Geometries; // The object containing all implicit geometries of the model.
244-
245189
unique_attributes: [string]; // An array of unique item attributes in this model.
246190
relation_names: [string]; // An array of unique relation names in this model.
247191
}

packages/fragments/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@thatopen/fragments",
33
"description": "Simple geometric system built on top of Three.js to display 3D BIM data efficiently.",
4-
"version": "3.1.7",
4+
"version": "3.2.0",
55
"author": "That Open Company",
66
"contributors": [
77
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
@@ -68,10 +68,10 @@
6868
"ts-node": "^10.0.0",
6969
"tsx": "^4.19.2",
7070
"typescript": "5.4.2",
71-
"web-ifc": "0.0.71"
71+
"web-ifc": "0.0.72"
7272
},
7373
"peerDependencies": {
7474
"three": ">=0.175",
75-
"web-ifc": ">=0.0.71"
75+
"web-ifc": ">=0.0.72"
7676
}
7777
}

packages/fragments/src/FragmentsModels/example.ts

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,7 @@ grids.create(world);
5757
// You have to copy `/node_modules/@thatopen/fragments/dist/Worker/worker.mjs` to your project directory
5858
// and provide the relative path in `workerUrl`
5959
// We use here the internal route of the worker in the library for simplicity purposes
60-
const githubUrl =
61-
"https://thatopen.github.io/engine_fragment/resources/worker.mjs";
62-
const fetchedUrl = await fetch(githubUrl);
63-
const workerBlob = await fetchedUrl.blob();
64-
const workerFile = new File([workerBlob], "worker.mjs", {
65-
type: "text/javascript",
66-
});
67-
const workerUrl = URL.createObjectURL(workerFile);
60+
const workerUrl = "../FragmentsModels/src/multithreading/fragments-thread.ts";
6861
const fragments = new FRAGS.FragmentsModels(workerUrl);
6962
world.camera.controls.addEventListener("rest", () => fragments.update(true));
7063

@@ -153,10 +146,7 @@ const [panel, updatePanel] = BUI.Component.create<BUI.PanelSection, any>(
153146
if (ids.includes(id)) {
154147
await disposeModels([id]);
155148
} else {
156-
await loadFragmentFile(
157-
`https://thatopen.github.io/engine_fragment/resources/frags/${id}.frag`,
158-
id,
159-
);
149+
await loadFragmentFile(`/resources/frags/${id}.frag`, id);
160150
}
161151
target.loading = false;
162152
};
@@ -183,11 +173,9 @@ const [panel, updatePanel] = BUI.Component.create<BUI.PanelSection, any>(
183173

184174
const arqLoaded = ids.some((id) => id.includes("arq"));
185175
const strLoaded = ids.some((id) => id.includes("str"));
186-
const mepLoaded = ids.some((id) => id.includes("mep"));
187176

188177
const arqLabel = arqLoaded ? "Remove Architecture" : "Load Architecture";
189178
const strLabel = strLoaded ? "Remove Structure" : "Load Structure";
190-
const mepLabel = mepLoaded ? "Remove Systems" : "Load Systems";
191179

192180
return BUI.html`
193181
<bim-panel id="controls-panel" active label="Fragments Models" class="options-menu">
@@ -200,10 +188,6 @@ const [panel, updatePanel] = BUI.Component.create<BUI.PanelSection, any>(
200188
<bim-button data-name="str" label=${strLabel} @click=${onLoadModel}></bim-button>
201189
${strLoaded ? BUI.html`<bim-button data-name="str" label="Download" @click=${onDownloadModel}></bim-button>` : null}
202190
</div>
203-
<div style="display: flex; gap: 0.25rem">
204-
<bim-button data-name="mep" label=${mepLabel} @click=${onLoadModel}></bim-button>
205-
${mepLoaded ? BUI.html`<bim-button data-name="mep" label="Download" @click=${onDownloadModel}></bim-button>` : null}
206-
</div>
207191
<bim-button ?disabled=${ids.length === 0} label="Remove All" @click=${onDisposeModels}></bim-button>
208192
</bim-panel-section>
209193
</bim-panel>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<!doctype html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport"
7+
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
8+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
9+
10+
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
11+
<link rel="icon" type="image/x-icon" href="https://thatopen.github.io/engine_components/resources/favicon.ico">
12+
<title>Create Elements</title>
13+
<style>
14+
body {
15+
margin: 0;
16+
padding: 0;
17+
font-family: "Plus Jakarta Sans", sans-serif;
18+
overflow: hidden;
19+
}
20+
21+
.full-screen {
22+
width: 100vw;
23+
height: 100vh;
24+
position: relative;
25+
overflow: hidden;
26+
}
27+
28+
.options-menu {
29+
position: fixed;
30+
min-width: unset;
31+
top: 5px;
32+
right: 5px;
33+
max-height: calc(100vh - 10px);
34+
max-width: 15rem;
35+
}
36+
37+
.phone-menu-toggler {
38+
visibility: hidden;
39+
}
40+
41+
@media (max-width: 480px) {
42+
.options-menu {
43+
visibility: hidden;
44+
bottom: 5px;
45+
left: 5px;
46+
max-width: none;
47+
}
48+
49+
.options-menu-visible {
50+
visibility: visible;
51+
}
52+
53+
.phone-menu-toggler {
54+
visibility: visible;
55+
position: fixed;
56+
top: 5px;
57+
right: 5px;
58+
}
59+
}
60+
</style>
61+
</head>
62+
63+
<body>
64+
<div class="full-screen" id="container"></div>
65+
<script type="module" src="./example.ts"></script>
66+
</body>
67+
68+
</html>

0 commit comments

Comments
 (0)