Skip to content

difference() has different behaviours with tube() than brick() meshes #27

Answered by jlvila
jlvila asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Jimy,

Difference

Thanks, for tube unexpected difference, I just change, as you suggested, the direction of the axis, and the result is as expected ;-)
I change vec3(0, 1, 0) to vec3(0, -1, 0) for the _circle.

The code

    def addTube(self, x, y, w, h, color: QColor):
        _radius = w/2.0
        _lenght = h
        _circle = flatsurface(wire(Circle((vec3(0), vec3(0, -1, 0)), _radius)))
        _tube = Tube3D(_circle, [
            vec3(0, 0, 0),
            vec3(0, _lenght, 0),
        ])
        brTranslated = _tube.transform(
            vec3(x+_radius, y, 0))
        brTranslated.option(color=vec3(color.red()/255.0,
                                       color.green()/255.0, color.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jlvila
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants