Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape, CAD, maker project and design.

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.

3D point

alberto_porrasalberto_porras Member Posts: 2 EDU
Hi,
I would like to know if it's possible to create a 3D point by coordinates. 
Sometimes it is useful to create geometry from a specific point, thus I need a 3D point.
Thanks a lot in advance

Answers

  • mahirmahir Member, Developers Posts: 777 ✭✭✭✭
    Manually, you would need to create a plane that intersects either the X, Y, or Z coordinate of the desired point. Then you can place a sketch point on that plane and dimension it accordingly.

    The more direct path would be to use featurescript. Here's an example script by @dave_cowden. It requires at least 2 points to be created, but it could be edited to allow an individual point.
    https://cad.onshape.com/documents/502108ab33bd9af500b73c1a/w/68f73347f084d40c31271b24/e/5c9b644bfa74fd744d6bf626
  • paul_chastellpaul_chastell Onshape Employees Posts: 82
    edited May 1
    Or, also with a custom feature, you could make a single point with one operation call, to opPoint, which takes (x,y,z) coordinates and make a point there.

    https://cad.onshape.com/documents/05e61f73d88c30ebe9e3baf8/w/6e72e2b08afb63489da10bdf/e/a7fc29bda73abe3a05aec06b

    annotation { "Feature Type Name" : "3D Point" }
    export const threePoint = defineFeature(function(context is Context, id is Id, definition is map)
        precondition
        {
            annotation { "Name" : "X" }
            isLength(definition.x, LENGTH_BOUNDS);
            annotation { "Name" : "Y" }
            isLength(definition.y, LENGTH_BOUNDS);
            annotation { "Name" : "Z" }
            isLength(definition.z, LENGTH_BOUNDS);        
        }
        {
            opPoint(context, id + "point", {
                    "point" : vector(definition.x, definition.y, definition.z)
            });
        });

    Paul Chastell / VP of R&D / Onshape Inc.
  • mahirmahir Member, Developers Posts: 777 ✭✭✭✭
    I'm surprised there isn't a general point FS out there that let's you create points from various inputs. Maybe my next project :)
  • mahirmahir Member, Developers Posts: 777 ✭✭✭✭
    edited May 1
    I think I'll take a crack at a flexible point FS this week. Here are the input options that I can think of. Can anyone think of any others that would be useful?
    • Intersection - intersects all queried geometries to get a point (e.g. 3 planes/surfaces, plane/surface & line, 2 planar lines)
    • Projection - normal projection of point onto a plane/surface
    • Along Curve - point located X% from either endpoint of a curve/edge
    • XYZ - point located via coordinates
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 647 ✭✭✭✭
    edited May 1
    mahir said:
    • Along Curve - point located X% from either endpoint of a curve/edge
    @mahir
    I would propose this option to work with multy-edge paths as well.
    UPD: and possibly when you will work on Intersection option you can make a subfeature which would create intersection wire body from sets of faces, which is also often needed
  • mahirmahir Member, Developers Posts: 777 ✭✭✭✭
    @mahir
    I would propose this option to work with multy-edge paths as well.
    UPD: and possibly when you will work on Intersection option you can make a subfeature which would create intersection wire body from sets of faces, which is also often needed
    Shouldn't be a problem. For multiple edges I'll just have to create a composite curve. As for the surface intersection, it looks like opBoolean does a good job of generating wire bodies. I'll just have to jump through a few hoops to feed it faces and planes as surface bodies.
  • mbartlett21mbartlett21 Member Posts: 749 EDU
    @mahir
    Here is a point FS: https://cad.onshape.com/documents/576d1e60c6cb90985345ac37
    It supports projection, coordinates,and intersection
  • mbartlett21mbartlett21 Member Posts: 749 EDU
    UPD: and possibly when you will work on Intersection option you can make a subfeature which would create intersection wire body from sets of faces, which is also often needed
    @konstantin_shiriazdanov
    Try this feature: https://cad.onshape.com/documents/84d939daceef6a928b8abcba
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 647 ✭✭✭✭
    edited July 6
    thanks @mbartlett21 will use it.  ;) though I would change the position of match type selector after the boolean block like this:

  • mahirmahir Member, Developers Posts: 777 ✭✭✭✭
    @mahir
    Here is a point FS: https://cad.onshape.com/documents/576d1e60c6cb90985345ac37
    It supports projection, coordinates,and intersection
    That's great you got something going, but the link doesn't lead anywhere.
  • mbartlett21mbartlett21 Member Posts: 749 EDU
    mahir said:
    @mahir
    Here is a point FS: https://cad.onshape.com/documents/576d1e60c6cb90985345ac37
    It supports projection, coordinates,and intersection
    That's great you got something going, but the link doesn't lead anywhere.
    @mahir Sorry, i forgot to make it public :)
  • mahirmahir Member, Developers Posts: 777 ✭✭✭✭
    That's better. I see you started with my half finished FS. Not much time for messing with code with a new baby around ¯\_(ツ)_/¯ 
  • mbartlett21mbartlett21 Member Posts: 749 EDU
    thanks @mbartlett21 will use it.  ;) though I would change the position of match type selector after the boolean block like this:

    @konstantin_shiriazdanov
    Try the new version 2.2, which adds localizedInFaces compatibility (With it set to true, it takes faces as input, which is cool)
  • mahirmahir Member, Developers Posts: 777 ✭✭✭✭
    edited July 9
    @mbartlett21 now add point along curve and you'll have all the targeted use cases :) And don't forget to support both length and and ratio along curve.
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 647 ✭✭✭✭
    edited July 9
    I recently realized that Curve generator FS not only works with parametrized sketches but it actually creates a curve for any set of features that define a point, so having few more ways to define a point becomes more usefull.
    I would also request in this feature option to delete a point or mate connector
  • mbartlett21mbartlett21 Member Posts: 749 EDU
    @mahir
    Done
    I can also add it for multiple points if you want :)
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 647 ✭✭✭✭
    I can also add it for multiple points if you want
    @mbartlett21 delete multiples would be good, thank you. i need this because some features can create a lot of instances of point/MC's which are later unnececessary. but standart delete body feature can do nothing with it
  • mbartlett21mbartlett21 Member Posts: 749 EDU
    edited July 10
  • mahirmahir Member, Developers Posts: 777 ✭✭✭✭
    @mahir
    Done
    I can also add it for multiple points if you want :)
    Sure, why not ;)
  • mbartlett21mbartlett21 Member Posts: 749 EDU
    @mahir
    Multiple Points along path: DONE!
  • mahirmahir Member, Developers Posts: 777 ✭✭✭✭
    @mahir
    Multiple Points along path: DONE!
    Nice work. Glad you have so much time on your hands :smile:

    on opBoolean Plus, can you make it work for surfaces with internal boundaries the same way that Find Intersection does. Either that, or maybe allow Find Intersection to generate either a point OR curve(s)?
  • mahirmahir Member, Developers Posts: 777 ✭✭✭✭
    edited July 11
    Now I'm just nitpicking, but can you edit the multi coordinate workflow to be more like the multi along curve? For multi curve you have a variable array input query, but for multi coordinate the user is forced to enter a specially formatted string array. It would be nice if you could just enter X/Y/Z (or R/Th/Z, R/Th/Ph) into their own box and just click "add point" to add another set of inputs, just the along curve.

    For that matter, the single/multi workflow seems to be pretty redundant for all the input types. For along and coordinate, if there is just one input, it's a single. If there is more than one, it's a multi. Same goes for projection. If one vertex is selected, it's a single. If more than one, it's a multi.

    The only "single" input left is intersection. That is currently limited to single points. 3 surfaces with 2 points of intersection currently fails. If possible, try to account for multiple intersections. I would also add support for intersecting curves with surfaces and again try to account for possible multiple intersection points. All these fringe cases are what held up my progress when trying to develop this FS myself, but if you have the time then these additions would make for a lot of versatility :)

    Last, but not least, maybe add an "equal split" option for along curve to create N points equally spaced along a curve, either with or without endpoints.

    All right, my wish list is over ;)
  • mbartlett21mbartlett21 Member Posts: 749 EDU
    @mahir
    I did the multi coordinate input like it is, so it would allow copy-pasting from excel or csv
  • mbartlett21mbartlett21 Member Posts: 749 EDU
    mahir said:
    @mahir
    Multiple Points along path: DONE!
    Nice work. Glad you have so much time on your hands :smile:

    on opBoolean Plus, can you make it work for surfaces with internal boundaries the same way that Find Intersection does. Either that, or maybe allow Find Intersection to generate either a point OR curve(s)?
    @mahir
    What find intersection does is boolean the two surfaces without any holes, then uses evDistance to find the intersection, as that is the only way i know to get the intersection of a curve and a face.
  • mahirmahir Member, Developers Posts: 777 ✭✭✭✭
    What find intersection does is boolean the two surfaces without any holes, then uses evDistance to find the intersection, as that is the only way i know to get the intersection of a curve and a face.
    Right, that's what I figured. I'm just suggesting that opBoolean Plus have that same option to perform the intersection without any internal surface holes. Maybe use a checkbox to turn the option on/off. Ideally, opBoolean could take these internal boundaries into account and generate multiple curves from a surface intersection. But in the mean time, it should at least not fail. 
Sign In or Register to comment.