Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bitbybit",
"version": "0.19.9",
"version": "0.20.0",
"description": "Monorepo for browser CAD which holds bitbybit.dev npm packages",
"main": "index.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion packages/dev/babylonjs/lib/api/bitbybit-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import {
GeometryHelper,
Lists,
Logic,
Transforms
Transforms,
Dates,
} from "@bitbybit-dev/base";
import {
JSCAD
Expand Down Expand Up @@ -56,6 +57,7 @@ export class BitByBitBase {
public jscad: JSCAD;
public manifold: ManifoldBitByBit;
public text: TextBitByBit;
public dates: Dates;
public tag: Tag;
public time: Time;
public occt: OCCTW & BaseOCCT;
Expand Down Expand Up @@ -94,6 +96,7 @@ export class BitByBitBase {
this.logic = new Logic();
this.json = new JSONBitByBit(this.context);
this.text = new TextBitByBit();
this.dates = new Dates();
this.lists = new Lists();
}

Expand Down
9 changes: 5 additions & 4 deletions packages/dev/babylonjs/lib/api/bitbybit/babylon/scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export class BabylonScene {
{ diameter: inputs.radius * 2 },
this.context.scene
);
sphere.metadata = { shadows: false };
const lightMaterial = new BABYLON.StandardMaterial(`LightMaterial${Math.random()}`, this.context.scene);
lightMaterial.diffuseColor = light.diffuse;
lightMaterial.specularColor = light.diffuse;
Expand Down Expand Up @@ -335,14 +336,14 @@ export class BabylonScene {
enableSkybox(inputs: Inputs.BabylonScene.SkyboxDto): void {
let texture: BABYLON.CubeTexture;
if (inputs.skybox === Inputs.Base.skyboxEnum.default) {
texture = new BABYLON.CubeTexture("https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.19.9/textures/skybox/default_skybox/skybox", this.context.scene);
texture = new BABYLON.CubeTexture("https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.0/textures/skybox/default_skybox/skybox", this.context.scene);
} else if (inputs.skybox === Inputs.Base.skyboxEnum.greyGradient) {
texture = new BABYLON.CubeTexture("https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.19.9/textures/skybox/grey_gradient/skybox", this.context.scene);
texture = new BABYLON.CubeTexture("https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.0/textures/skybox/grey_gradient/skybox", this.context.scene);
} else if (inputs.skybox === Inputs.Base.skyboxEnum.clearSky) {
texture = BABYLON.CubeTexture.CreateFromPrefilteredData("https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.19.9/textures/skybox/clear_sky/environment.env",
texture = BABYLON.CubeTexture.CreateFromPrefilteredData("https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.0/textures/skybox/clear_sky/environment.env",
this.context.scene, false, false);
} else if (inputs.skybox === Inputs.Base.skyboxEnum.city) {
texture = BABYLON.CubeTexture.CreateFromPrefilteredData("https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.19.9/textures/skybox/city/environmentSpecular.env",
texture = BABYLON.CubeTexture.CreateFromPrefilteredData("https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@0.20.0/textures/skybox/city/environmentSpecular.env",
this.context.scene, false, false);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/dev/babylonjs/lib/api/inputs/scene-inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ export namespace BabylonScene {
shadowMaxZ = 1000;
/**
* Shadow min Z
* @default 0
* @default 0.1
* @minimum 0
* @maximum Infinity
* @step 50
*/
shadowMinZ = 0;
shadowMinZ = 0.1;
}
export class ActiveCameraDto {
constructor(camera?: BABYLON.Camera) {
Expand Down
232 changes: 116 additions & 116 deletions packages/dev/babylonjs/package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions packages/dev/babylonjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bitbybit-dev/babylonjs",
"version": "0.19.9",
"version": "0.20.0",
"description": "Bit By Bit Developers BABYLONJS CAD Library to Program Geometry",
"main": "index.js",
"repository": {
Expand Down Expand Up @@ -54,13 +54,13 @@
"types": "./index.d.ts",
"type": "module",
"dependencies": {
"@babylonjs/core": "7.54.0",
"@babylonjs/gui": "7.54.0",
"@babylonjs/loaders": "7.54.0",
"@babylonjs/materials": "7.54.0",
"@babylonjs/serializers": "7.54.0",
"@babylonjs/core": "8.1.1",
"@babylonjs/gui": "8.1.1",
"@babylonjs/loaders": "8.1.1",
"@babylonjs/materials": "8.1.1",
"@babylonjs/serializers": "8.1.1",
"@babylonjs/havok": "1.3.10",
"@bitbybit-dev/core": "0.19.9",
"@bitbybit-dev/core": "0.20.0",
"earcut": "2.2.3"
},
"devDependencies": {
Expand Down
268 changes: 268 additions & 0 deletions packages/dev/base/lib/api/inputs/dates-inputs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
/* eslint-disable @typescript-eslint/no-namespace */

// tslint:disable-next-line: no-namespace
export namespace Dates {
export class DateDto {
constructor(date?: Date) {
if (date !== undefined) { this.date = date; }
}
/**
* The date
* @default undefined
*/
date: Date;
}

export class DateStringDto {
constructor(dateString?: string) {
if (dateString !== undefined) { this.dateString = dateString; }
}
/**
* The date string
* @default undefined
*/
dateString: string;
}

export class DateSecondsDto {
constructor(date?: Date, seconds?: number) {
if (date !== undefined) { this.date = date; }
if (seconds !== undefined) { this.seconds = seconds; }
}
/**
* The date to update the seconds for
* @default undefined
*/
date: Date;
/**
* The seconds of the date
* @default 30
* @minimum 0
* @maximum Infinity
* @step 1
*/
seconds = 30;
}

export class DateDayDto {
constructor(date?: Date, day?: number) {
if (date !== undefined) { this.date = date; }
if (day !== undefined) { this.day = day; }
}
/**
* The date
* @default undefined
*/
date: Date;
/**
* The day of the date
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
day = 1;
}

export class DateYearDto {
constructor(date?: Date, year?: number) {
if (date !== undefined) { this.date = date; }
if (year !== undefined) { this.year = year; }
}
/**
* The date
* @default undefined
*/
date: Date;
/**
* The year of the date
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
year = 1;
}

export class DateMonthDto {
constructor(date?: Date, month?: number) {
if (date !== undefined) { this.date = date; }
if (month !== undefined) { this.month = month; }
}
/**
* The date
* @default undefined
*/
date: Date;
/**
* The month of the date
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
month = 1;
}

export class DateHoursDto {
constructor(date?: Date, hours?: number) {
if (date !== undefined) { this.date = date; }
if (hours !== undefined) { this.hours = hours; }
}
/**
* The date
* @default undefined
*/
date: Date;
/**
* The hours of the date
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
hours = 1;
}

export class DateMinutesDto {
constructor(date?: Date, minutes?: number) {
if (date !== undefined) { this.date = date; }
if (minutes !== undefined) { this.minutes = minutes; }
}
/**
* The date
* @default undefined
*/
date: Date;
/**
* The minutes of the date
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
minutes = 1;
}

export class DateMillisecondsDto {
constructor(date?: Date, milliseconds?: number) {
if (date !== undefined) { this.date = date; }
if (milliseconds !== undefined) { this.milliseconds = milliseconds; }
}
/**
* The date
* @default undefined
*/
date: Date;
/**
* The milliseconds of the date
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
milliseconds = 1;
}

export class DateTimeDto {
constructor(date?: Date, time?: number) {
if (date !== undefined) { this.date = date; }
if (time !== undefined) { this.time = time; }
}
/**
* The date
* @default undefined
*/
date: Date;
/**
* The time of the date
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
time = 1;
}
export class CreateFromUnixTimeStampDto {
constructor(unixTimeStamp?: number) {
if (unixTimeStamp !== undefined) { this.unixTimeStamp = unixTimeStamp; }
}
/**
* The unix time stamp
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
unixTimeStamp = 1;
}
export class CreateDateDto {
constructor(year?: number, month?: number, day?: number, hours?: number, minutes?: number, seconds?: number, milliseconds?: number) {
if (year !== undefined) { this.year = year; }
if (month !== undefined) { this.month = month; }
if (day !== undefined) { this.day = day; }
if (hours !== undefined) { this.hours = hours; }
if (minutes !== undefined) { this.minutes = minutes; }
if (seconds !== undefined) { this.seconds = seconds; }
if (milliseconds !== undefined) { this.milliseconds = milliseconds; }
}
/**
* The year of the date
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
year = 1;
/**
* The month of the date
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
month = 1;
/**
* The day of the month
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
day = 1;
/**
* The hours of the date
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
hours = 1;
/**
* The minutes of the date
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
minutes = 1;
/**
* The seconds of the date
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
seconds = 1;

/**
* The milliseconds of the date
* @default 1
* @minimum 0
* @maximum Infinity
* @step 1
*/
milliseconds = 1;
}

}
1 change: 1 addition & 0 deletions packages/dev/base/lib/api/inputs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export * from "./text-inputs";
export * from "./vector-inputs";
export * from "./transforms-inputs";
export * from "./base-inputs";
export * from "./dates-inputs";
1 change: 1 addition & 0 deletions packages/dev/base/lib/api/inputs/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export * from "./text-inputs";
export * from "./text-inputs";
export * from "./vector-inputs";
export * from "./transforms-inputs";
export * from "./dates-inputs";
Loading