Hello Team,
While trying to convert the json object , i am getting error that says type undefined by three js lib.
my json
var jsonObj = {
"data": {
"type": "properties",
"collection": [
// {
// "objectid": 25369,
// "name": "Polyface Mesh [631C]",
// "externalId": "631C",
// "properties": {
// "General": {
// "Handle": "631c",
// "Name ": "Polyface Mesh",
// "Color": "ByBlock",
// "Layer": "0",
// "Linetype": "ByLayer",
// "Linetype scale": "1.000",
// "Plot style": "ByColor",
// "Lineweight": "ByLayer",
// "Transparency": "ByLayer"
// },
// "3D Visualization ": {
// "Shadow Display": "Casts and Receives shadows",
// "Material": "BYBLOCK"
// },
// "Mesh": {
// "Number of vertices": "4",
// "Number of faces": "2"
// }
// }
// },
{
"objectid": 25377,
"name": "Line [6324]",
"externalId": "6324",
"properties": {
"General": {
"Handle": "6324",
"Name ": "Line",
"Color": "ByBlock",
"Layer": "0",
"Linetype": "ByLayer",
"Linetype scale": "1.000",
"Plot style": "ByColor",
"Lineweight": "ByLayer",
"Transparency": "ByLayer",
"Thickness": "0.000 in"
},
"3D Visualization ": {
"Material": "BYBLOCK"
},
"Geometry": {
"Length": "177.000 in",
"Angle": "0.000 deg"
}
}
},
// {
// "objectid": 25378,
// "name": "Line [6325]",
// "externalId": "6325",
// "properties": {
// "General": {
// "Handle": "6325",
// "Name ": "Line",
// "Color": "ByBlock",
// "Layer": "0",
// "Linetype": "ByLayer",
// "Linetype scale": "1.000",
// "Plot style": "ByColor",
// "Lineweight": "ByLayer",
// "Transparency": "ByLayer",
// "Thickness": "0.000 in"
// },
// "3D Visualization ": {
// "Material": "BYBLOCK"
// },
// "Geometry": {
// "Length": "160.375 in",
// "Angle": "270.000 deg"
// }
// }
// },
// {
// "objectid": 25379,
// "name": "Line [6326]",
// "externalId": "6326",
// "properties": {
// "General": {
// "Handle": "6326",
// "Name ": "Line",
// "Color": "ByBlock",
// "Layer": "0",
// "Linetype": "ByLayer",
// "Linetype scale": "1.000",
// "Plot style": "ByColor",
// "Lineweight": "ByLayer",
// "Transparency": "ByLayer",
// "Thickness": "0.000 in"
// },
// "3D Visualization ": {
// "Material": "BYBLOCK"
// },
// "Geometry": {
// "Length": "177.000 in",
// "Angle": "180.000 deg"
// }
// }
// },
// {
// "objectid": 25380,
// "name": "Line [6327]",
// "externalId": "6327",
// "properties": {
// "General": {
// "Handle": "6327",
// "Name ": "Line",
// "Color": "ByBlock",
// "Layer": "0",
// "Linetype": "ByLayer",
// "Linetype scale": "1.000",
// "Plot style": "ByColor",
// "Lineweight": "ByLayer",
// "Transparency": "ByLayer",
// "Thickness": "0.000 in"
// },
// "3D Visualization ": {
// "Material": "BYBLOCK"
// },
// "Geometry": {
// "Length": "160.375 in",
// "Angle": "90.000 deg"
// }
// }
// },
// {
// "objectid": 25454,
// "name": "Lines (4)",
// "externalId": "Lines",
// "properties": {}
// },
// {
// "objectid": 29,
// "name": "Model",
// "externalId": "1F",
// "properties": {}
// }
]
}
}
Code i am using
const loader = new THREE.ObjectLoader();
const object = loader.parse( jsonObj );
scene.add(object)
Any one suggest me whats going wrong here.
Thanks