GithubHelp home page GithubHelp logo

aalavandhaann / blueprint-js Goto Github PK

View Code? Open in Web Editor NEW
485.0 32.0 154.0 273.36 MB

The Javascript es6 version of the original furnishup/blueprint3d. Need some royalty free low poly models for the inventory. Can someone help me with this?

License: MIT License

CSS 0.03% HTML 0.26% JavaScript 99.13% Python 0.58%
floorplan floorplans blueprint blueprintjs blueprints-rendering 2d-floorplan threejs blueprint3d parametric cabinet

blueprint-js's People

Contributors

aalavandhaann avatar aravendsriram avatar delenzhang avatar thinkia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blueprint-js's Issues

Shadows from Walls

I tried to have shadows in the models and the items cast shadow but not the walls. Can it be related with Mesh objects? I see that items are meshes whereas the walls are not.

I have added the "castShadow" property to the newWall object in forEach in "loadFloorplan" method and also the Wall class itself, but no luck so far. I just could not get them casting the shadow.

Is there a parameter or something like that preventing the walls to cast the shadow ?

Can't add some objects in 3D

Describe the bug
When clicking on some 3D objects to add them to the scene, a error occurs and the object isn't added to the scene.

To Reproduce
Create a new layout

  1. Go to 3D
  2. Click on Toilet
  3. Open developer console
  4. See error : TypeError: "cached is undefined"

Expected behavior
Object is added to the scene

Screenshots
Screenshot 2019-03-16 at 14 16 18

Desktop (please complete the following information):

  • OS: MacOs
  • Browser firefox
  • Version 65.0.1

Fix
Simply adding typeof cached !== 'undefined fixes the problem and makes it possible to add the object to the scene. However being relatively new to this project, I don't know in which library it uses I should submit a PR.
There are many occurrences of the faulty line:
Screenshot 2019-03-16 at 14 11 40

Thanks for your work!

How to add new models to the project ?

Hi,
Congrats on your outstanding work, it really is amazing. However, I could not figure out how to add more models to the project. I know that the models are stored in the file system and read through the items.js file. Now, I would like to add some other blender 3d objects such as:
https://free3d.com/3d-model/toilet-lavatory-loo-38457.html

As you can see the model includes ".obj" extension which I intend to use, in this case should I convert this object file to json file ? If yes, how ? I have seen some python scripts but I do not know how to use them. If no, which instructions should I follow for the algorithm to handle the .obj files.

Cheers.

TOTAL FLOOR AREA

Hi, I would like to ask about where is the script or code in blueprint3d.js or bpdj.js where the total area is displayed on the center of the floorplan ? Thanks

Adding Text

How can I add some text for describe object?

Format..

I want to know that what kind of format design.blueprint3d have??

I used this link https://blackthread.io/gltf-converter/
to convert the json file into gltf but when i upload this design.blueprint3d file in this converter then this give error like invalid json file.

so i want to know that which format in this file?

take the stair and possibilty of collision detection

Hi
Thanks for this great work. I have a request that I think can make this project even greater.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I'm always frustrated when I'm passing through wall , object or stair

Describe the solution you'd like
A clear and concise description of what you want to happen.

The possibility to add collision detection on wall or object and have the possibiliy to take the stair

Additional context
Add any other context or screenshots about the feature request here.

https://www.babylonjs.com/demos/espilit/
A demo with babylon.js when there is collision detection and you can take the stair

add function gltf exporter

I used blueprint3d.js and i want to add glft exporter function.When include this function in example.js file and i get some error in my console like GLTFExporter is not define.Can you help me with that

//gltf exporter
  function SaveDesign() {
    var data = blueprint3d.model.exportSerialized();
    var exporter = new GLTFExporter();
    exporter.parse(data, function (result) {
      var output = JSON.stringify(result, null, 2);
      console.log(output);
      downloadJSON(output, "scene.gltf");
    });
  }

Thanks

Adding movable lights to the scene

Hi #OK,

I would like to be able to add some different kinds of lights to the scene but I want them to be movable so that I can save the light objects to the config file and load them again on a refresh.

For that end, do you think using the Item class to create the lights as movable objects in the scene or should I follow some other logic to achieve it ?

Cheers !

total wall and floor area

Hi, is there a function/module in this project where I can get the total floor area and total wall area of floorplan?
Thanks

How to scale the floor plan ?

I have some floor plans that belong to real properties. What I want to do is scale the floor plan according to the real floor plan so that the final model would be consistent with the property size.

To this end, I could not find where the length of the walls (in the floor plan) are is computed. I suppose it is a simple subtraction between two 2d vectors. When subtract the "start" and "end" corner points in newWall method, it gives me the non-rounded lengths of the walls. However, I could not find where this very same computation is done in the code (whether it is in Walls or Corners) ?

Please check the image given below, it is an example of the case that I tried to describe above.

oie_p7zyvg7kvmhn

Here, as you can see at the right bottom corner there is the scale of the floor plan which indicates how long are the walls of the property in the floor plan.

So my idea is to put this image as a background of "floorplanner" div. Then, I will basically draw on the scale line (at the bottom) starting from 0 to 5m. Then I will consider this line (wall) as 5 meters. Finally, I will draw the walls (going over the background image like a carbon paper). What I expect is to have the model (3d) in the proper scale of the property.

Any suggestions how can I scale the distances between corners or/and walls ?

Thanks in advance.

GLTF models render incompletely

I tried to put the GLTF loader code into the original Blueprint3d project, the program can render the model without errors but that appears like
Screen Shot 2019-04-08 at 12 29 28

obviously a part of the model is missing from the item. Yet, the problem does NOT appear in this project.
Screen Shot 2019-04-09 at 09 24 10

I have tried to match the code between the original BP3D project with this project and I do not see any major difference between the two for the addItem part. So any of you may know the reason causing the problem?

adding new floor-plan

Hi, First of all, thanks for your great project!

I'm Trying to load new floor-plan using the file app.js and changing the myHome variable to DWG file I converted to json.

When I'm trying doing so, I keep getting an error in the bp3djs.min.js in the function "var Model = function (_EventDispatcher)" (line 106111)

I guess the parsing in the library doesn't work well with the conversion.

I'm trying to find a way to take a DWG file and show it using the blueprint project.

Thanks a lot!

Internet Explorer

Hi #OK,

The code does not run on Internet Explorer since it is implemented in ES6 standards. I have made some changes in the code that I do not want to loose. Therefore, I have been searching for a way to compile the code from ES6 into ES5.
I have been compiling the code with Babel but it does not seem to be working. It compiles the most of the code correctly but there are still some missing things.

Is there a straightforward way to do it ?

P.S: I have just found out about Babel so I am no pro about that.

Cheers

last update error app.js:984

hello:
last update causes the following error

(app.js:984 Uncaught TypeError: Cannot read property 'currentFloor' of null
at HTMLAnchorElement. (app.js:984)
at HTMLAnchorElement.dispatch (jquery-2.1.4.min.js:3)
at HTMLAnchorElement.r.handle (jquery-2.1.4.min.js:3))

and does not add objects

How do you do?

I am Wencheng and very interesting in your project.
I installed your project on my laptop, analyzed details.
As you mentioned, there are many problems in this one.
I'm going to co-operate with you.
Let me know what do you say.
Thanks.

export plan feature request

Is your feature request related to a problem? Please describe.

I would like to have my floor plan on my website

Describe the solution you'd like

I would like to create my floorplan with blueprint-js and then export it on my website

Describe alternatives you've considered

Maybe the possibility to export a pdf file of the floorplan created

"Delete" button doesnt work

Amazing concept ! when i try deleting the product via 3d designers from the right sidebar it doesnt work, is there any fix for this ? thank you.

Hi,Hope you are fine

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

the item not appear when load the items from webservice

I changed the items_gltf.js file to load the item from webservice .

	function getItems() {
		$.get("http://www.mocky.io/v2/5ce15e3e320000112d2f62dd", function (data) {
			for (var i = 0; i < data.length; i++) {
				var item = data[i];
				item.time = parseInt(Math.random() * 100);
				itemsDiv = $("#" + modelTypesIds[modelTypesNum.indexOf(item.type)] + "-wrapper");
				var modelformat = (item.format) ? ' model-format="' + item.format + '"' : "";
				//var html = '<button type="button"  onclick="onAddItem(' + item.time + ')" class="btn btn-primary" data-dismiss="modal" alt="Add Item">' + item.name + '[' + item.time + ']' + '</button>';

				//var html = '<div class="col-sm-4">' + '<a class="thumbnail add-item"' + ' model-name="' + item.name + '"' + ' model-url="' + item.model + '"' + ' model-type="' + item.type + '"' + modelformat + '>' + '<img src="' + item.image + '" alt="Add Item"  data-dismiss="modal" > ' + item.name + '</a></div>';
				
				var html = '<div class="col-sm-4">' + '<a class="thumbnail add-item"' +' model-name="'+ item.name +'"' +' model-time="'+ item.time +'"' +' model-url="' +item.model+'"' +' model-type="' +item.type+'"' + modelformat+'>'+'<img src="'+item.image +'" alt="Add Item"   data-dismiss="modal" 	> '+item.name +'</a></div>';
	
				itemsDiv.append(html);
			}

		});
	}
	getItems(); 

if I add the item to the scene it's not appeared

items_gltf.txt

A podcast to help users of blueprint-js

** do you think a live video session is useful?**
If the users feel they can communicate their requirements much more effectively through periodic live YouTube interactively then I will be happy to host one. It can be weekly, bi-monthly or whatever the time dictates

Let me know your thoughts

How to bypass wall creation process to create outdoor walls

Hi #OK,

I was wondering how can I force the code to create an outdoor wall not an interior one. The outdoor ones has an white edge on the top and they seem thicker and they only have back-side edge.

I would like to have the same type inside of the property. How should I change the code for that ?

Thanks !

First person

Hello .

How can we use first-person on the phone.
Is there a solution ?

Thanks..

Bug on Collision Detection

Describe the bug
The collision detection routine does not seem to be working properly.

To Reproduce
Steps to reproduce the behavior:

  1. Change the return statement to false inside the if statement in 'isValidPoisiton' in 'FloorItem' class.
  2. Just move an floor item through a wall or outside the model.

Expected behavior
When an item is moved through a wall or to outside of the walls (property), the movement should be disabled. However, the current implementation work strange, mostly just the opposite of what it should be doing.

Additional context
There was a bug in 'pointInPolygon' function. The if statement which makes a call to 'lineLineIntersect' method was not passing with proper parameters properly. I have change the call into:

if (Utils.lineLineIntersect(start, point, {x: tFirstCorner.x, y: tFirstCorner.y}, {x: tSecondCorner.x, y: tSecondCorner.y})) {
                            tIntersects++;
                        }

The change is on 'firstCorner' and 'secondCorner'. Now they are being passed like tuples.

Anyways, even after fixing this bug, the is something wrong with the computation I guess.

Dragging item offset

Describe the bug
The 3D viewer works fine if it's positioned at the right of the window

To Reproduce

  1. Create a viewer container smaller than the window's width
  2. Put some items (furnitures) in there
  3. Try to move them again and you will see there is some offset compare the original position.

Expected behavior
You should be able to move items correctly in differents container's width and alignments. It works fine only if the container is align completly to the right of the window

Desktop

  • OS: Windows 10
  • Browser Chrome
  • Version 79
    Screenshot_1

save 2d model

how can save and load 2d model in json or xml format?

Setting it up online?

Hellow. I've stumbled upon on blueprint3d project about a year ago, liked the script, decided that it's too hard for me to figure out all the steps by myself.
A year passed, your version looks really cool, the problem is still the same :-)
Wanted to know if you can help me to set up the script and make a tutorial on how to export 3d models from sketchup and import it to blueprint3d
Thanks.

GLTF Loader parsing issue

Describe the bug
GLTF models are not parsed very well. There are some models that are rendered correctly, however most of the model set that I have are not rendered correctly. I think the reason for that is the "addItem" function. There is a callback function called "gltfCallback" and there happens a parsing process that takes all the meshes of the Object3d objects and merges the geometries and materials. I think that the if-else part that parses the geometries after materials are parsed is the problem.

Expected behavior
This is a screenshot that is obtained from a gltf viewer and this is how it is supposed to look like:

Screenshot from 2019-04-01 12-51-30

Screenshots
And this is what I see in the render. As you can see, newmaterials array (texture list) is updated correctly but not the newGeometry one (I guess).

Screenshot from 2019-04-01 12-53-16

The GLTF Loader itself is okay, when I directly add the model to the scene, it is quite fine. However, when the model is processed by the "addItem" function before an item object is created, this weird behavior happens. Obj models are loaded fine tho, there is no problem with them.

I also share the model that I am referencing for you to understand and repeat the experiment yourself. Any idea, how can I fix this ?

kitchen_gltf_model.zip

Thanks in advance !

How to resize Wall

Hi Aalavandhaann,

Thanks for Customizing blueprint3d to a fantastic project(Semma Project Thalaiva),i just want to know how to resize the wall interms of height,width and thickness these properties are present inbuild for items but i want for wall,please help me out

Thanks & Regards,
Siva

Integrating with React

Hello,

any glues on implementing this with React?
I would like to draw walls based on a json with x and y values.

Import own Objects

Hey, how it is possible to create own objects.
I saw that every object is just a .js file. But is there an documentation to generate such a .js file?
Did i need a tool for this.

Thanks for your help.

Multiple floors / Different levels on same floor

Is your feature request related to a problem? Please describe.
I am trying to draw my floorplan to integrate with a smart home assistant and I am unable to do different levels / floors - It would be great to have that as a feature.

Describe the solution you'd like
As a user, I would like to have the ability to designate heights of floors and be able to add multiple floors to the floorplan.

Describe alternatives you've considered
Just making them all on the same plan, one above the other. This is probably ok for most cases - being able to do different floor levels ( my dining and living are the same room, but dining is elevated by 2 steps ) would be great.

Additional context
Happy to provide if required.

Draw wall or other object

how to draw wall or other object like simple emoji or a sign programmatically?
for example i want to draw a wall from poin a to b or insert a alarm icon in special place

Objects cannot be added in this modification BluePrint3D.

Can't added objects on 3D-plane in Demo version and Locale version.

  1. Go to '3D'
  2. Click on '+'
  3. Insert any object 'click'
  4. See nothing on 3D-plane.

Desktop:

  • OS: Catalina 10.15.5
  • Chrome, 84.0.4147.89

There is also a bug on the local version.

Question regarding object position

Hello,
I'm trying to get object coordinates with respect to the bottom left corner of the room-so that the coordinates of the bottom left corner will always be 0-0-0-, provided that the room will always be a rectangle. Is there any way to do this?
Thanks!

Sunlight through the windows ?

Hi #OK,

How can I set the windows and/or their materials so that I will have the light passing through the windows just like a sunlight ? Or do I have to use something like Volumetric Light instead of a point light ?

Thanks in advance !

Use design.blueprint3d in A-frame?

Hi,
Is it possible to use/load Design.blueprinted file as model in A-frame to view as VR ?
like wise you used .glft model..
Need Help

Question

Hi Srinivasan
Your work looks amazing
Would you consider making some tutorials about this ?
about How you convert a 2d floorplaner in 3d ? How your dispatchEvent are used with their type and item ? Some lines to explain how it works under the hood

code not found

Where is the code of EVENT_GLTF_READY module?

I only see in events.js file
export const EVENT_GLTF_READY = 'GLTF_READY_EVENT';

Getting Warnings in the console

Hi Aalavandhan,

I'm getting lots of warnings in the console regarding THREE.Loader andTHREE.WebGLRenderer, also in the demo link given in the project contains the same warnings!!!

Thanks,
Siva

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.