How to distort group of curves as in photoshop command?

Hi,
V5
I have traced a photo of a rectangular object taken at a perspective angle, now in photoshop it would be dead easy to remap this back to the orthographic shape of the rectangle, see video, one side can be moved independently of the other, shortened/lengthened, angled in or out, up/down etc.

2016-03-18_0332

For raster images turning on controlPoints allows this, BUT I HAVE Rhino curves.

If I turn on control points they all appear, I simply want some kind of control box with 3 points per side. of 2 dimensional shape. just as in photoshop. so I can move those few handles and achieve the effects I want.

Bend, Twist, Skew, none are of use, Distort is what is needed.

I did try BoundingBox but then having got a coloured surface I failed to bond the curves to it and control the surface with 3 handles per side.

How is this distort as in photoshop done ?

Steve

Command “CageEdit” Option -> Rectangle -> Set UPointCount=2 VPointCount=2

Hi,
Many thanks,
I see 4 points in total, unlike distort with 8, but no doubt if it had points midway on sides they would warp outwards the middle portion only of the sides, as opposed to allowing the entire side to be pulled out, so instead I select two points at one side then move them together.

With such distort, you move one point and better the fit, but it then has altered another previous good fir, so a lot of redoing and tail chasing.

I wish there was a way of saying DistortBestFit, choose a point on the target shape, then the same point on the object to be distorted, repeat for next pair, and so on, then hit enter and a best fit ‘distort’ would occur, all in a planar manner, to a planar target with a planar source.

That would be awesome.

If it could also work with a trace of a photo grouped to the photo, so the raster also gets distorted as well, even better.

THIS WOULD BE IN FACT FANTASTIC.

Steve

I have a plugin for AutoCAD (something I was considering porting to Rhino) that may provide that functionality. I’d like to try the plugin with your curves. If you post a file, I’ll round-trip it through AutoCAD/Plugin and post the results back here as a Rhino file.

This screencast shows the Ortho to Perspective transformation, but the plugin can do the reverse as well.

Hi,
I am finding that if I nudge my distorted (CageEdited) curves or move with arrow etc I get message, ‘use undo as its lost the cage’.
doing so obviously gets me back to before the move.

I need to distort then be able to move the entire ensemble without losing the control cage, how is that done ?

To have this associated cage from then on and to need to keep it wherever I put that object is a pain. To have it deny me moving the object is a hole in the head.

Sheer tool sheers, wish there was a distort tool free of any encumberances.

Hi Seant,
attached a file showing blue, orange and red cab sides I wish to marry up to an accurate ortho view, these are traces from various non ortho photos, some more oblique than others. I suspect the measured one is wider aft of cab door, an extra 4 inches at the base kink being added on. Turned off is what I managed to do with various scale2d, rotate etc .

Use of Distort.3dm (2.5 MB)

Steve

Hi,
help !!
still needing to know, having used cageedit to distort my curves, how can I then move the distorted curves to where I need them as I get that message ‘use undo as its lost the cage’.

Steve

Normally, if you just move the cage (not the curves), the captive curves will come with it. --Mitch

Hi,
ok.

Principle of distort tool failing here, In Pshop, the gap between railings diminishes with distance , as in a real photo of railings.

HOWEVER doing a quick test, the gap remains same using this CageEdit method.

It should diminish with distance, as in the photoshop treatment of the same shape.

(I established with a pic of railings many years ago that photoshop distort tool recreated the logarithmic gap diminishing pattern), their perspective tool doesnt but distort tool does :-), great for such tasks, even undistorting a photograph of a plan etc !

see attached.


the darker red lines are where pshop correctly puts the wheel and box relationship lines, not the same gap at near and far that cageEdit created for the further stretched ‘red’ test…

I am trying to establish the gap between wheel and box when seen in perspective. I need to predict in a perspective photo where the box comes to as I can only se the nearside and offfside tyre edges. I have my vanishing lines traced on the photo to show near and far wheels as they are, then created a target shape to match my shape to and in absence of DistortTool use the suggested CageEdit method Rectangle, U 2 V 2.

so CageEdit is failing in this concept.

How does one create the logarithmic perspective true mathematical effect of Pshops distort tool ?

I need to do so for this wheel/box picture match. In the ortho side view I need to see the nearside and farside box edges.
here is the rhino file with 3D situation.
UseOfDistortToolTyreBoxTask.3dm (6.7 MB)

Steve

Hi,

Anyone know how to achieve the perspective logarithmic gap decrease , see image.

Having to export to photoshop (with export as ai failing) to use their distort tool, which will do this, is more long winded and loses CAD accuracy. With ai export also having big issues, see other post, I need to keep this process within Rhino.

Steve

I’d love to use your AutoCAD plugin. Where can I find it (for AutoCAD)? I’ve had to bring AutoCAD lines into Max in the past to perform this sort of transformation which is a big time-suck!

Thanks,
Dennis

I’m not exactly sure what to make of some of the posted geometry. Ideally, though, there will be some orthographically aligned rectangle upon which to base the transformation. Look at this screen cast as an example:

Given the proper setup geometry, the trans can go either way:

Even a 3D to planar projection:

The app can be found at Autodesk Exchange:
https://apps.autodesk.com/ACD/en/Detail/Index?id=7033830822584405086&appLang=en&os=Win32_64

Hi Seant,

did my posted file prove of use ?

let me explain the jpg again , the Blue shape lower right, when treated to Rhino CageEdit rectangle U 2 V 2 gives the orange lines result, far gap and near gap no different at 6.57.

dk red lines are same blue shape applied to the tapering shape with photoshop and distort tool, giving correct gap difference.

Can you create an array of equidistant lines like a railing fence, then make the fence have a perspective angle as in my jpg , that will show me if the gaps between the railings have a logarithmic decrease with distance.

here is my simple quest again, made simpler, attached.
UseOfDistortTool v2.3dm (6.7 MB)

and here is pshop on same SIMPLE task.

Steve

I ‘round tripped’ this through AutoCAD, then back to Rhino. The add-in needs geometry in the World Top coordinate system, hence the reorientation.UseOfProjectTool.3dm (7.5 MB)

Hi ,
Hope at last…that looks like its ok.

any chance of a set of railings ? I have a feeling they will look fine :slight_smile:

Now how do we get that plugin for Rhino ? Taking me hours going back and forth into pshop and then tracing over the raster output.

Can someone write a script to do that ?

Steve

Here’s a set of railings, I think, as well as a couple other curve samples.

Unfortunately, that will take some time. I haven’t worked with the Rhino API yet so I’ll need to get up to speed.RailingAndOther.3dm (485.5 KB)

Seant, thats it, oh WOW !!! Need that again today on a different project.

now why havent we that in Rhino.

**

Anyone else able to assist ,

**

Steve

I need to create an elipse representing a circle seen at an angle, the centre axis of the circle/now elipse, will be NOT in the middle of the elipse but a bit further towards the far edge, using control points to move the elipse major axis causes the far half to look too bulged, need this tool of Seant to create the effect.

Any other way of doing it ?

Else its another trip to Photoshop, do it in raster then trace over it, thats not CAD, loses the technical accuracy.

Steve

Perhaps you could use layouts generally instead of Photoshop if you are tracing geometry. If you enable a detail in the layout page, then ‘DollyZoom’ to get the perspective looking good, then trace in the layout page - the detail view is frozen so zooming and panning are no problem and you can use the osnaps to make an accurate tracing

Set the detail to a given scale, then copy and paste back into modelspace and scale up the traced geometry to that scale

Hi Brian,
Not aware of layouts at all as never needed such, is there a video or tutorial on how to do what you are suggesting anywhere ?
Steve

Could you not just draw a circle and rotate it in one of the orthographic views to the elliptical shape you want and use the Make2D command to get a 2D ellipse in your preferred shape? You may need to relocate the Gumball to get the center to appear off-center.

Dennis