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.

how to use mirrorAcross

papawopapawo Member, Developers Posts: 206 PRO
Tagged:

Best Answer

Answers

  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,380
    What are you hoping to accomplish?

    Calling mirrorAcross returns a 'Transform' which can be used in a variety of ways. A few examples: a transform could be used in applyPattern() to mirror a part or it can be multiplied by a  world space 'Vector' to mirror that vector across the plane in question.
    https://cad.onshape.com/FsDoc/library.html#module-transform.fs

    The concept is similar to a transformation matrix in linear algebra:
    https://en.wikipedia.org/wiki/Transformation_matrix
    Jake Rosenfeld - Modeling Team
  • papawopapawo Member, Developers Posts: 206 PRO
    i just want to do this. 

  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,380
    You can use the 'mirror' feature:

    mirror(context, id + "mirror", {
            "patternType" : MirrorType.PART,
            "entities" : a query for the part you want to mirror,
            "mirrorPlane" : a query for a face you want to mirror across.  In this case you could use qCreatedBy(makeId("Front"), EntityType.FACE) to get the front plane,
            "operationType" : NewBodyOperationType.ADD,  <-- same as "Add" in the feature dialog
            "defaultScope" : false, <-- same as turning off "Merge with all" in the feauture dialog
            "booleanScope" a query for what you want the result to boolean onto <-- same as "Merge scope" in the feature dialog
        })
    If you don't want to boolean the result onto the seed, you can just leave out the last 3 parameters.
    Jake Rosenfeld - Modeling Team
  • papawopapawo Member, Developers Posts: 206 PRO
    What if the “front plane” doesnt exist?
    how to create or get that plane without user selecting the face?
  • papawopapawo Member, Developers Posts: 206 PRO
    thanks, I think I can work on that.
Sign In or Register to comment.