Skip to content

How to create a TubeGeometry - use of Three.Curve #286

Open
@hagrid67

Description

@hagrid67

In your notebook examples/Geometries.ipynb you have the following for TubeGeometry:

# TODO: handling THREE.Curve
TubeGeometry(
    path=None,

I've naively tried using a LineCurve3 for the path but I get an error along the following lines:

TraitError: The 'path' trait of a TubeGeometry instance must be a Curve or None, but a value of class 'pythreejs.extras.curves.LineCurve3_autogen.LineCurve3' (i.e. LineCurve3()) was specified.

Is there a way to get TubeGeometry to work as things stand? Or can you sketch out what work would need to be done?

Comparing this with another example where a constructor takes another pythreejs object:

ball = Mesh(geometry=SphereGeometry(radius=1, widthSegments=32, heightSegments=24), 
            material=MeshLambertMaterial(color='red'),
            position=[2, 1, 0])

Here I find that SphereGeometry is configured in three-class-config.js to have superClass BaseGeometry. Whereas LineCurve3 has a fairly empty configuration, and the autogen python has only ThreeWidget rather than Curve as its superclass.

Many thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions