Home › Forums › Programming › v3d.ConvexGeometry
- This topic has 9 replies, 4 voices, and was last updated 4 weeks ago by
Alexander Kovelenov.
-
AuthorPosts
-
2018-01-19 at 11:09 am #1718
Yaroslav
ParticipantWhen trying to call an empty constructor, i keep getting the following error:
Uncaught TypeError: v3d.ConvexGeometry is not a constructor
I am using an example from the docs, nothing spectacular in the code. What might be the case?
2018-01-19 at 1:27 pm #1719Yuri Kovelenov
Staff2018-01-19 at 2:43 pm #1722Yaroslav
ParticipantThanks, made that thing to work.
2025-05-22 at 7:40 am #82069David Duperron
CustomerHi Yuri!
Where and how do you link these additionnal classes files??
Thanks for the help!David
2025-05-22 at 9:42 am #82072Yuri Kovelenov
StaffHi David,
Please note that this older code is no longer officially supported, but you can give it a try:
https://github.com/Soft8Soft/verge3d-code-examples/blob/master/jsm/geometries/ConvexGeometry.js2025-05-23 at 10:23 am #82117David Duperron
CustomerHi Yuri,
Yeah I know, still the same subject. But What I am struggling with is to be able to import these classes in order to be able to use them in my Puzzles (with javascript puzzles indeed).
I’ve managed to import these classes using:
import('./js/lines/Line2.js').then((Lines2Module) => { do something with Lines2Module.classes});
It works fine, but it is “temporary” and if I need to re-use the same classes later I need to re-import them and do what I want.
Is there a way to permanently import these additionnal classes and use them when needed in my Puzzles?
I know this is more a pure javascript question, but probably someone has the answer out there!
CheersDavid
-
This reply was modified 4 weeks, 1 day ago by
David Duperron.
2025-05-23 at 11:43 am #82122Alexander Kovelenov
StaffHi,
Indeed, the examples in the repo are intended for module-based loading (hence the “jsm” folder). You might try non-module versions for your app instead. They were available in the repo before Verge3D 4.3 (use d90282ee6bd4f00959665fefe986ded799ee5122 commit ID to checkout the “js” folder that contains them).
Alternatively, you can refactor the “modularized” versions making the work as vanilla js scripts.
2025-05-23 at 1:19 pm #82123David Duperron
CustomerHi!
Thank you for that! I guess I figured out by myself how to “demodularize” the files by adding the v3d namespace to the classes that were already included in v3d.js (instead of importing them).
But I was missing thev3d.Line2 = Line2;
at the end to make the new class available… I learn new things everyday! :p2025-05-23 at 1:21 pm #82124David Duperron
CustomerAnd by the way, these line2 and LineGeometries are really worth including in your base classes I think. They allow very nice things for line rendering, which look much better than the line rendering which is provided now… but perhaps I’m missing other problems.
Anyway for my own App, it is now working perfectly.2025-05-23 at 3:35 pm #82128Alexander Kovelenov
Staff -
This reply was modified 4 weeks, 1 day ago by
-
AuthorPosts
- You must be logged in to reply to this topic.