Up to Next Surface for Curves

Hello everyone,

I’d like to be able to create a line starting a a vertex, with a given direction and ending at a surface of unknown ID, (essentially I would like to know the distance along a direction from a point to a surface). In other CAD software I’ve used there is an up to next feature but I haven’t been able to figure out if there is such a thing in cubit (I understand cubit is primarily for meshing, so not a big deal). I figured I would check before hacking something together with the python interface.

Thanks,

Edgar

Hi @Edgar21,
this sounds like you need the command

measure between {entity <id>|location <options>|plane <options>|axis <options> }
     with {entity <id>|location <options>|plane <options>|axis <options> }

https://coreform.com/cubit_help/cubithelp.htm#t=geometry%2Fmeasuring_btw_entities.htm

Here is a short example.

#!cubit
reset
create vertex location -1 -1 -1
create surface circle radius 1 xplane
measure between vertex 1 surface 1

Thanks for the response, unfortunately I don’t know the surface I want to measure too, I have a point, and a direction in which there is a surface, but I don’t have a priori information as to which surface (100s to thousands of surfaces in my model) will be in that direction, if that makes sense.

I am thinking of just making the line extremely long and determining which surface it intersects, then making a vertex at that crossing and measuring between the starting vertex the vertex where the line crosses the surface, but I would like to avoid iterating through all the surfaces in my model to find the one that is along the direction vector starting at the initial point.

Hi Edgar,

You might be able to do this by using the create curve <location> <location> command where the second location is specified using the fire ray``` location option. The command syntax is complex, but it works.

For example,

reset
brick x 10
vol 1 move x 10 y 5
create curve location 0 0 0 location fire ray location 0 0 0 direction 1 1 0 at surface all maximum hits 1

The first location 0 0 0 specifies the start point. The end point is specified by a ray with the start location 0 0 0 a direction vector 1 1 0 and an ending surface. In this case, I searched all surfaces but I’m only selecting the first intersection by using the maximum hits 1 option.

There is an additional option on fire ray, ray radius <value>, that can be used to tweak the tolerance for intersection calculations. The documentation indicates that this is required for curve intersections.

Here is a link to the documentation (it should point directly to fire ray), Coreform Cubit 2024.3 User Documentation

Does that look like a solution to your problem?
Karl

1 Like

Yes it does! Thats awesome that theres a ray fire command, thanks for the help!