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.

Mapping faces from a plane onto another plane

noé_perard_gayotnoé_perard_gayot Member Posts: 3

I'm trying to make a function that "wraps" a plane onto a plane or onto a curved surface. It works for curved surfaces :

    const targetWrap is WrapSurface = makeWrapSurface(context, definition.target);
    const sketchPlane is Plane = evOwnerSketchPlane(context, { "entity" : definition.faces });
    var result is Query = qNothing();
    if (!isWrapPlane(context, targetWrap))
    {
        opWrap(context, id + "map", {
                    "wrapType" : WrapType.TRIM,
                    "entities" : definition.faces,
                    "source" : makeWrapPlane(sketchPlane),
                    "destination" : targetWrap
                });
        result = qCreatedBy(id + "map", EntityType.BODY);
    }
    else
    {
        const targetPlane is Plane = evPlane(context, { "face" : definition.target });
        const moveFaces is Query = qEntityFilter(definition.faces, EntityType.FACE);
        const planemap is Transform = transform(sketchPlane, targetPlane);
        debug(context, moveFaces, DebugColor.RED);
        opMoveFace(context, id + "map", {
                "moveFaces" : moveFaces,
                "transform" : planemap,
        });
        result = qCreatedBy(id + "map");
    }
image.png

The result when extruding the query `result` is somewhat strange (moved from a plane to an offset plane) .

I'm sure there's an obvious solution, but for now I don't have a clue.

Comments

  • EvanReeseEvanReese Member, Mentor Posts: 2,516 PRO

    If your goal is to transform the letters from the cSys of sketchPlane to the cSys of targetPlane, then moveFace() isn't probably what you want. Look at opTransform().

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
Sign In or Register to comment.