Why I can t create Face3 in ThreeJS Typescript project

0 votes

I am trying to create Mesh by using Face3. I am using Threejs in typescript project. There are several problems I am facing.

const points = [
     new Face3(-1, 1, -1),//c
     new Face3(-1, -1, 1),//b
     new Face3(1, 1, 1),//a

     new Face3(1, 1, 1),//a
     new Face3(1, -1, -1),//d
     new Face3(-1, 1, -1),//c

     new Face3(-1, -1, 1),//b
     new Face3(1, -1, -1),//d
     new Face3(1, 1, 1),//a

     new Face3(-1, 1, -1),//c
     new Face3(1, -1, -1),//d
     new Face3(-1, -1, 1),//b
]
let geometry = new Geometry();
for (const point of points) {
     geometry.faces.push(point);
}

First of all, I can't add this geometry into mesh. It gives me error that it is not a BufferGeometry

enter image description here

If I try to create a new BufferGeometry from Geomtery, I can't find property fromGeometry

enter image description here

If these kind of functions has been deprecated, then what is the exact alternative for this? Why there is no proper guideline or instruction available? Is there anyone who can suggest me better solution.

Jul 5, 2022 in TypeSript by Logan
• 2,140 points
475 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In TypeSript

0 votes
1 answer

What is TypeScript and why would I use it in place of JavaScript?

TypeScript is a superset of JavaScript which primarily ...READ MORE

answered May 31, 2022 in TypeSript by Nina
• 3,060 points
342 views
0 votes
0 answers

What is TypeScript and why would I use it in place of JavaScript?

Can you please describe what the TypeScript ...READ MORE

Jul 18, 2022 in TypeSript by Logan
• 2,140 points
217 views
0 votes
1 answer

How to create ES6 Map in Typescript

Refer this as an example this.configs = new ...READ MORE

answered May 31, 2022 in TypeSript by Nina
• 3,060 points
445 views
0 votes
1 answer

How to create enum type in TypeScript?

TypeScript 0.9+ has a specification for enums: enum ...READ MORE

answered Jun 8, 2022 in TypeSript by Nina
• 3,060 points
660 views
0 votes
1 answer

How do I extend a TypeScript class definition in a separate definition file?

If you don't have control over the ...READ MORE

answered Jun 10, 2022 in TypeSript by Nina
• 3,060 points
2,212 views
0 votes
1 answer

How can I define a type for a CSS color in TypeScript?

There was a proposal for a type of ...READ MORE

answered Jun 15, 2022 in TypeSript by Nina
• 3,060 points
3,425 views
0 votes
1 answer
0 votes
1 answer

Mixing JavaScript and TypeScript in Node.js

Combine the following TypeScript compiler options --allowJs Explicitly supports ...READ MORE

answered Jun 15, 2022 in TypeSript by Nina
• 3,060 points
457 views
0 votes
1 answer

NodeJS email-templates i18n localization

The i18n object does not appear to ...READ MORE

answered Jun 16, 2022 in Node-js by Neha
• 9,060 points
1,555 views
0 votes
0 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP