Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

opPlane, what are height and length relative to?

dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
export function opPlane(context is Context, id is Id, definition is map)

I expected that 'length' and 'height' are always relative to the x and y directions of the defined Plane. 

However, i've found that they do not behave this way. Instead, the height and width seem to be based on something else. 

Consider this code:

        const HEIGHT = 0.02;
        const WIDTH = 0.04;
        
        const plane1 = plane ( vector(0,0,0), vector( 1, 0, 0 ), vector( 0, 0, 1) );
        opPlane(context, id + "plane1", {
            "plane": plane1,
            "width": WIDTH,
            "height": HEIGHT
        });
        
        const plane2 = plane ( vector(0.05,0,0), vector(1, 0, 0 ), vector( 0, 0, 1) );
        opPlane(context, id + "plane2", {
            "plane": plane2,
            "width": WIDTH,
            "height": HEIGHT
        });    


The difference between plane1 and plane2 is the direction of the x axis. I expect the height or the width to be consistently oriented along the x axis of the plane, but both of the above codes give the same result visually:




It appears that the height and width are relative to something other than the orientation of the plane? 

Comments

  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    sorry, i somehow posted an older version of my code, of course the x direction in the code above is not different between plane1 and plane2.  But if you change that, you'll see the orientation of the plane still does not change...
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,173
    We do align plane coordinate systems to some canonical orientation (this is done because the interactive experience was deemed better that way -- in particular, if the plane normal is aligned with x, y, or z, than the plane coordinate system will be aligned with the other two coordinate vectors).  Keep in mind that width and height of the plane are purely visual -- they should not have an effect on the B-rep (unlike sketches where you have control over the coordinate system).  However, if you do an evPlane on the result of an opPlane, you will get back the canonical coordinate system rather than the one passed in.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    hmm ok thanks for the clarification. That makes sense i guess.  
  • adamohernadamohern Member, OS Professional Posts: 216 PRO
    We do align plane coordinate systems to some canonical orientation (this is done because the interactive experience was deemed better that way...)
    I can't disagree more here. This is a bad call IMO, as the current behavior limits users to strictly orthogonal design thinking. If the designer is creating prismatic shapes that are always aligned to x y or z, this is an excellent system. For those of us building anything with angled faces, this is incredibly frustrating.

    Explicit and intelligent plane alignment is crucial to good parametric design. I hope we get it soon!
Sign In or Register to comment.