Skip to content

Conversation

shensquared
Copy link
Contributor

the Ring and Circle geometries were added back in summer and they do load successfully. The new Text is just mimicking that modification.

@rdeits
Copy link
Collaborator

rdeits commented Nov 7, 2018

Cool! Is this still giving the same error you mentioned in #28 ?

@shensquared
Copy link
Contributor Author

yes, this is what's giving me the missing uuid error

@rdeits
Copy link
Collaborator

rdeits commented Nov 7, 2018

What's the full error message?

@shensquared
Copy link
Contributor Author

close this PR as we are attempting a different approach in meshcat-dev/meshcat#43

@gnthibault
Copy link
Contributor

gnthibault commented Sep 29, 2021

@shensquared sorry to bring this again, but where can I find examples of how to use either text, circles or plane in meshcat python ? Is there a generic class that can be used to create those geometries ?

EDIT: ok somehow I found my way out:

class Circle(Geometry):
    """
    from https://threejs.org/docs/#api/en/geometries/RingGeometry
    """
    def __init__(self, radius, nb_segment=20):
        """
        innerRadius — Default is 0.5.
        outerRadius — Default is 1.
        thetaSegments — Number of segments. A higher number means the ring will be more round. Minimum is 3. Default is 8.
        phiSegments — Minimum is 1. Default is 1.
        thetaStart — Starting angle. Default is 0.
        thetaLength — Central angle. Default is Math.PI * 2.
        """
        Geometry.__init__(self)
        self.innerRadius = radius
        self.outerRadius = radius
        self.thetaSegments = nb_segment
        self.phiSegments = 1
        self.thetaStart = 0
        self.thetaLength = 2*np.pi

    def lower(self, object_data):
        return {
            u"uuid": self.uuid,
            u"type": u"RingGeometry",
            u"innerRadius": self.innerRadius,
            u"outerRadius": self.outerRadius,
            u"thetaSegments": self.thetaSegments,
            u"phiSegments": self.phiSegments,
            u"thetaStart": self.thetaStart,
            u"thetaLength": self.thetaLength
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants