Skip to content

Commit

Permalink
remove 3d capabiltities
Browse files Browse the repository at this point in the history
  • Loading branch information
emilwidlund committed Jul 5, 2024
1 parent 1441b75 commit cb1b550
Show file tree
Hide file tree
Showing 13 changed files with 126 additions and 135 deletions.
5 changes: 3 additions & 2 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@
"@types/react-dom": "^18.0.7",
"@types/three": "^0.161.2",
"@types/ws": "^8.5.10",
"autoprefixer": "^10.4.16",
"autoprefixer": "^10.4.19",
"eslint": "^8.53.0",
"postcss": "^8.4.32",
"postcss": "^8.4.39",
"prettier": "^3.1.0",
"tailwindcss": "^3.4.4",
"typescript": "^5.2.2"
},
"type": "module"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
Warnings:
- The values [MESH_3D,GEOMETRY_3D,RENDERER_3D] on the enum `NodeType` will be removed. If these variants are still used in the database, this will fail.
*/
-- AlterEnum
BEGIN;
CREATE TYPE "NodeType_new" AS ENUM ('ADDITION', 'SUBTRACTION', 'MULTIPLICATION', 'DIVISION', 'MODULO', 'POWER', 'SQUARE_ROOT', 'ABSOLUTE', 'SINE', 'COSINE', 'TANGENT', 'ARCSINE', 'ARCCOSINE', 'ARCTANGENT', 'LOGARITHM', 'LOGARITHM2', 'EXPONENTIAL', 'PI', 'EULER', 'MIN', 'MAX', 'CEIL', 'FLOOR', 'ROUND', 'RANDOM', 'SIGN', 'TRIAD_COLOR', 'TETRADIC_COLOR', 'ANALOGOUS_COLOR', 'COMPLEMENTARY_COLOR', 'SQUARE_COLOR', 'TO_HSV', 'FROM_HSV', 'TO_HSL', 'FROM_HSL', 'TO_RGB', 'FROM_RGB', 'GRADIENT', 'IMAGE', 'WEBCAM', 'IMAGE_VARIATION_AI', 'PROMPT_AI', 'CIRCUIT', 'CIRCUIT_INPUTS', 'CIRCUIT_OUTPUTS', 'TIMER', 'CONSOLE', 'LERP', 'CUBIC_BEZIER', 'OSCILLATOR', 'IMAGE_EDIT_AI', 'SYNTHESIZED_IMAGE', 'VISION');
ALTER TABLE "nodes" ALTER COLUMN "type" TYPE "NodeType_new" USING ("type"::text::"NodeType_new");
ALTER TYPE "NodeType" RENAME TO "NodeType_old";
ALTER TYPE "NodeType_new" RENAME TO "NodeType";
DROP TYPE "NodeType_old";
COMMIT;
3 changes: 0 additions & 3 deletions apps/web/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ enum NodeType {
CONSOLE
LERP
CUBIC_BEZIER
MESH_3D
GEOMETRY_3D
RENDERER_3D
OSCILLATOR
IMAGE_EDIT_AI
SYNTHESIZED_IMAGE
Expand Down
7 changes: 1 addition & 6 deletions apps/web/src/app/(landing)/CircuitExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
CanvasStore
} from '../../circuit';
import { nodeWindowResolver } from '../../windows';
import { Mesh } from '@bitspace/nodes/3d';

export const CircuitExample = () => {
const circuitStore = useMemo(() => {
Expand All @@ -27,16 +26,14 @@ export const CircuitExample = () => {
const toHSV = new ToHSV();
const sHarmonyNode = new SquareHarmony();
const hsvNode = new FromHSV();
const meshNode = new Mesh();

timer.setPosition(-2000, 100);
multiplication.setPosition(-1000, 100);
multiplication2.setPosition(-1400, -50);
osc.setPosition(-1000, -50);
toHSV.setPosition(-450, 100);
sHarmonyNode.setPosition(0, 200);
hsvNode.setPosition(450, 420);
meshNode.setPosition(450, -20);
hsvNode.setPosition(450, 200);

circuit.addNode(timer);
circuit.addNode(multiplication);
Expand All @@ -45,7 +42,6 @@ export const CircuitExample = () => {
circuit.addNode(toHSV);
circuit.addNode(sHarmonyNode);
circuit.addNode(hsvNode);
circuit.addNode(meshNode);

timer.outputs.milliseconds.connect(multiplication.inputs.a);
multiplication.outputs.output.connect(toHSV.inputs.hue);
Expand All @@ -54,7 +50,6 @@ export const CircuitExample = () => {
osc.outputs.output.connect(toHSV.inputs.saturation);
toHSV.outputs.color.connect(sHarmonyNode.inputs.color);
sHarmonyNode.outputs.a.connect(hsvNode.inputs.color);
sHarmonyNode.outputs.c.connect(meshNode.inputs.color);

const circuitStore = new CanvasStore(circuit);

Expand Down
44 changes: 0 additions & 44 deletions apps/web/src/windows/MeshWindow.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions apps/web/src/windows/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import { AnalogousHarmony } from '../../../../packages/nodes/src/color/Analogous
import { FromHSV } from '../../../../packages/nodes/src/color/FromHSV/FromHSV';
import { CubicBezierWindow } from './CubicBezierWindow';
import { CubicBezier } from '../../../../packages/nodes/src/easings/CubicBezier/CubicBezier';
import { MeshWindow } from './MeshWindow';
import { Mesh } from '../../../../packages/nodes/src/3d/Mesh/Mesh';
import { ImageEditWindow } from './ImageEditWindow';
import { ImageEdit } from '../../../../packages/nodes/src/ai/ImageEdit/ImageEdit';
import { Gradient, Image, Oscillator } from '@bitspace/nodes';
Expand All @@ -40,8 +38,6 @@ export const nodeWindowResolver: NodeWindowResolver = (node: Node) => {
return <ImageEditWindow node={node as ImageEdit} />;
case 'Cubic Bezier':
return <CubicBezierWindow node={node as CubicBezier} />;
case 'Mesh':
return <MeshWindow node={node as Mesh} />;
case 'Oscillator':
return <OscillatorWindow node={node as Oscillator} />;
case 'Triad Harmony':
Expand Down
45 changes: 0 additions & 45 deletions packages/nodes/src/3d/Mesh/Mesh.ts

This file was deleted.

16 changes: 0 additions & 16 deletions packages/nodes/src/3d/index.ts

This file was deleted.

4 changes: 4 additions & 0 deletions packages/nodes/src/descriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const NodeDescriptionsMap: Record<NodeType, string> = {
[NodeType.IMAGE_VARIATION_AI]:
'Returns a new image based on the input image & a given instruction prompt',
[NodeType.PROMPT_AI]: 'Returns text based on the input prompt',
<<<<<<< HEAD
[NodeType.VISION]: 'Returns text based on the input image',

[NodeType.GEOMETRY_3D]:
Expand All @@ -84,4 +85,7 @@ export const NodeDescriptionsMap: Record<NodeType, string> = {
[NodeType.RENDERER_3D]: 'Renders a given Mesh to a WebGL Context',
[NodeType.FROM_VECTOR]:
'Returns the individual components of a given Vector'
=======
[NodeType.VISION]: 'Returns text based on the input image'
>>>>>>> 7dcc164 (remove 3d capabiltities)
};
8 changes: 3 additions & 5 deletions packages/nodes/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { EasingNode, EasingNodeConstructor, EasingNodes } from './easings';
import { UtilityNodes, UtiliyNodeConstructor, UtilityNode } from './utilities';
import { ColorNode, ColorNodeConstructor, ColorNodes } from './color';
import { AINode, AINodeConstructor, AINodes } from './ai';
import { ThreeDNode, ThreeDNodeConstructor, ThreeDNodes } from './3d';
import {
PrimitiveNodeConstructor,
PrimitiveNodes,
Expand All @@ -21,7 +20,6 @@ export * from './easings';
export * from './utilities';
export * from './color';
export * from './ai';
export * from './3d';
export * from './primitives';
export * from './interface';

Expand All @@ -34,7 +32,6 @@ export type Nodes =
| ColorNode
| EasingNode
| MathNode
| ThreeDNode
| UtilityNode
| CircuitNode;

Expand All @@ -45,7 +42,6 @@ export type NodeConstructor =
| ColorNodeConstructor
| EasingNodeConstructor
| MathNodeConstructor
| ThreeDNodeConstructor
| UtiliyNodeConstructor
| CircuitNodeConstructor;

Expand All @@ -60,6 +56,7 @@ export const NodeGroups = [
nodes: MathNodes
},
{
<<<<<<< HEAD
name: 'Interface',
nodes: InterfaceNodes
},
Expand All @@ -68,6 +65,8 @@ export const NodeGroups = [
nodes: ThreeDNodes
},
{
=======
>>>>>>> 7dcc164 (remove 3d capabiltities)
name: 'Easing',
nodes: EasingNodes
},
Expand All @@ -93,7 +92,6 @@ export const NodeConstructors: NodeConstructor[] = [
...InterfaceNodes,
...PrimitiveNodes,
...AINodes,
...ThreeDNodes,
...MathNodes,
...EasingNodes,
...ColorNodes,
Expand Down
3 changes: 0 additions & 3 deletions packages/nodes/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ export enum NodeType {
CONSOLE = 'CONSOLE',
LERP = 'LERP',
CUBIC_BEZIER = 'CUBIC_BEZIER',
MESH_3D = 'MESH_3D',
GEOMETRY_3D = 'GEOMETRY_3D',
RENDERER_3D = 'RENDERER_3D',
OSCILLATOR = 'OSCILLATOR',
IMAGE_EDIT_AI = 'IMAGE_EDIT_AI',
SYNTHESIZED_IMAGE = 'SYNTHESIZED_IMAGE',
Expand Down
4 changes: 3 additions & 1 deletion packages/schemas/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { z } from 'zod';
import { Mesh } from 'three';
import { minMaxNumber } from './utility';

export const AnySchema = () => z.any().describe('Any');
Expand Down Expand Up @@ -40,6 +39,7 @@ export const EasingSchema = () =>
])
.describe('Easing');

<<<<<<< HEAD
export const MeshSchema = () => z.instanceof(Mesh).describe('Mesh');

export const Vector2Schema = (...args: Parameters<typeof minMaxNumber>) =>
Expand Down Expand Up @@ -78,6 +78,8 @@ export const VectorSchema = (...args: Parameters<typeof minMaxNumber>) =>
])
.describe('Vector');

=======
>>>>>>> 7dcc164 (remove 3d capabiltities)
export * from './utility';
export * from './color';
export * from './gradient';
Loading

0 comments on commit cb1b550

Please sign in to comment.