Closed jamesleesaunders closed 1 year ago
Have you considered to use a prototype to get a torus?
Here is an example of a Torus, which can be modified to get what you want, for instance to implement a angle property.
https://github.com/create3000/Library/blob/main/Prototypes/Geometry3D/Torus.x3d
You would define the proto within the Scene element before you use it, then add a ProtoInstance element:
<ProtoInstance name='Torus' containerField='geometry'>
<fieldValue name='minorRadius' value='2'/>
<fieldValue name='majorRadius' value='3'/>
</ProtoInstance>
Note: X3DOM does not support protos as far as I know.
Here are some proto examples form We3d3d.org https://x3dgraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/.
Yes, a torus proto would be possible and could mimic the x3dom torus. x3dom does now support protos but has the important restriction that the <script>
node is not implemented:
https://github.com/x3dom/x3dom/wiki/Prototypes
(It would be very cool if x_ite would support the vrml style 'short' xml syntax <Torus majorRadius='5' />
for instances which is non-standard.)
Nop, will not implement this 'short' syntax. The ProtoInstance
element is well specified and compatible to other browsers. To implement this will lead to a parser change, which is not desired. The parser is cleaner without this syntax.
Thanks Guys, Although I am not sure how I would integrate prototypes into d3-x3d (as the while point of the library is we use D3 and JS to generate the X3D - it would be difficult and a little incestuous for D3/JS to generate the Githubissues.
Please could you add a Torus shape component to X_ITE? https://doc.x3dom.org/author/Geometry3D/Torus.html
I have a 'donut chart' component in d3-x3d which works in x3dom: https://raw.githack.com/jamesleesaunders/d3-x3d/master/examples/X3DOM/chart/DonutChart.html
But at the moment it looks like Torus is not supported by X_ITE: https://raw.githack.com/jamesleesaunders/d3-x3d/master/examples/X_ITE/chart/DonutChart.html
Error:
I have tried reverting back to Full profile also.
I would be willing to contribute myself and have has a look at the code around here https://github.com/create3000/x_ite/tree/main/src/standard/Math/Geometry but would not have a clue where to start!