Skip to content

Commit

Permalink
Update examples to new API
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed Oct 3, 2023
1 parent f4cf7c5 commit ed0bab5
Show file tree
Hide file tree
Showing 23 changed files with 102 additions and 185 deletions.
3 changes: 1 addition & 2 deletions src/civil/RoadNavigator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@
scene.add(ambientLight);

const grid = new OBC.SimpleGrid(components, new THREE.Color(0x666666));
components.tools.add('grid', grid);
const customEffects = components.renderer.postproduction.customEffects;
customEffects.excludedMeshes.push(grid.get());

let fragments = new OBC.FragmentManager(components);
let fragmentIfcLoader = new OBC.FragmentIfcLoader(components, fragments);
let fragmentIfcLoader = new OBC.FragmentIfcLoader(components);

const mainToolbar = new OBC.Toolbar(components, { name: 'Main Toolbar', position: 'bottom' });
components.ui.addToolbar(mainToolbar);
Expand Down
1 change: 0 additions & 1 deletion src/core/MaterialManager/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
scene.add(ambientLight);

const grid = new OBC.SimpleGrid(components);
components.tools.add("grid", grid);

/*MD
### 👨‍🎨 Seamless Material Control
Expand Down
1 change: 0 additions & 1 deletion src/core/ScreenCuller/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
scene.add(ambientLight);

const grid = new OBC.SimpleGrid(components);
components.tools.add("grid", grid);

/*MD
Expand Down
2 changes: 0 additions & 2 deletions src/core/Simple2DScene/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
components.camera.controls.setLookAt(10, 10, 10, 0, 0, 0);

const grid = new OBC.SimpleGrid(components);
components.tools.add("grid", grid);

const boxMaterial = new THREE.MeshStandardMaterial({color: '#6528D7'});
const boxGeometry = new THREE.BoxGeometry(3, 3, 3);
Expand Down Expand Up @@ -72,7 +71,6 @@
*/

const simple2dScene = new OBC.Simple2DScene(components);
components.tools.add("Simple2DScene", simple2dScene);

/*MD
Great! Now we can start adding things to it, just like we would with the
Expand Down
7 changes: 0 additions & 7 deletions src/core/SimpleClipper/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
components.scene.setup();

const grid = new OBC.SimpleGrid(components);
components.tools.add("grid", grid);

/*MD
### ✂️ Clipping Tool
Expand Down Expand Up @@ -110,15 +109,9 @@
*/

components.tools.add("clipper", clipper);
clipper.enabled = true;

/*MD
:::tip Adding it to the tools component
The Tools Component will help you keep your code tidy. For more information about the Tools component, check out
[its own tutorial](./ToolsComponent.mdx). 🔍
:::
### ⏏️ Creating a Toolbar for the Clipper
---
Expand Down
1 change: 0 additions & 1 deletion src/core/SimpleRaycaster/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
components.scene.setup();

const grid = new OBC.SimpleGrid(components);
components.tools.add("grid", grid);

/*MD
### 🤏 Touching things
Expand Down
7 changes: 0 additions & 7 deletions src/core/SimpleScene/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,8 @@
*/

const grid = new OBC.SimpleGrid(components);
components.tools.add("grid", grid);

/*MD
:::tip Adding it to the tools component
The Tools Component will help you keep your code tidy. For more information about the Tools component, check out
[its own tutorial](./ToolsComponent.mdx). 🔍
:::
🚀 Also, let's add some real geometry to our small 3D app. All the components are built on top of
[Three.js](https://threejs.org/), which means that Three.js code will work natively with them.
Expand Down
1 change: 0 additions & 1 deletion src/fragments/FragmentBoundingBox/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
scene.add(ambientLight);

const grid = new OBC.SimpleGrid(components, new THREE.Color(0x666666));
components.tools.add("grid", grid);
const gridMesh = grid.get();
renderer.postproduction.customEffects.excludedMeshes.push(gridMesh);

Expand Down
2 changes: 1 addition & 1 deletion src/fragments/FragmentCacher/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
*/

const fragments = new OBC.FragmentManager(components);
let fragmentIfcLoader = new OBC.FragmentIfcLoader(components, fragments);
let fragmentIfcLoader = new OBC.FragmentIfcLoader(components);
fragmentIfcLoader.settings.webIfc.COORDINATE_TO_ORIGIN = true;
fragmentIfcLoader.settings.webIfc.OPTIMIZE_PROFILES = true;
fragmentIfcLoader.settings.wasm = {
Expand Down
5 changes: 2 additions & 3 deletions src/fragments/FragmentExploder/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
scene.add(ambientLight);

const grid = new OBC.SimpleGrid(components, new THREE.Color(0x666666));
components.tools.add("grid", grid);
const gridMesh = grid.get();
const effects = renderer.postproduction.customEffects;
effects.excludedMeshes.push(gridMesh);
Expand Down Expand Up @@ -113,7 +112,7 @@
*/

const classifier = new OBC.FragmentClassifier(components, fragments);
const classifier = new OBC.FragmentClassifier(components);

/*MD
Expand Down Expand Up @@ -145,7 +144,7 @@
*/

const exploder = new OBC.FragmentExploder(components, fragments, classifier);
const exploder = new OBC.FragmentExploder(components);

/*MD
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/FragmentHider/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
even after closing the browser and opening it again:
*/

const hider = new OBC.FragmentHider(components, fragments, undefined, true);
const hider = new OBC.FragmentHider(components);
await hider.loadCached();

/*MD
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/FragmentIfcLoader/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
*/

let fragments = new OBC.FragmentManager(components);
let fragmentIfcLoader = new OBC.FragmentIfcLoader(components, fragments);
let fragmentIfcLoader = new OBC.FragmentIfcLoader(components);

/*MD
:::info Why not just IFC?
Expand Down
1 change: 0 additions & 1 deletion src/fragments/FragmentManager/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
scene.add(ambientLight);

const grid = new OBC.SimpleGrid(components, new THREE.Color(0x666666));
components.tools.add("grid", grid);
const gridMesh = grid.get();
const effects = components.renderer.postproduction.customEffects;
effects.excludedMeshes.push(gridMesh);
Expand Down
1 change: 0 additions & 1 deletion src/fragments/FragmentTree/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
scene.add(ambientLight);

const grid = new OBC.SimpleGrid(components, new THREE.Color(0x666666));
components.tools.add("grid", grid);
components.renderer.postproduction.customEffects.excludedMeshes.push(grid.get());

/*MD
Expand Down
Loading

0 comments on commit ed0bab5

Please sign in to comment.