Can someone define Conformal?

Can someone define Conformal?

michellem
Advocate Advocate
717 Views
5 Replies
Message 1 of 6

Can someone define Conformal?

michellem
Advocate
Advocate

Hello;

 

I received this error message when trying to apply a Transform to a curve (simple 2d line): "transform is not conformal". I was hoping someone could define what "conformal" is and is not.

 

In case it is relevant, here is the code I was trying in Revit Python Shell:

x = selection[0]
y = Transform.Identity 
print x
print y

y.BasisX = XYZ(0.5,0,0)
y.BasisY = XYZ(0,2,0)
x.GeometryCurve.CreateTransformed (y)

where selection[0] is a preselected detail line.

 

The error message is:

Exception: transform is not conformal.
Parameter name: transform

 

Sincerely;

Michelle

 

0 Likes
Accepted solutions (3)
718 Views
5 Replies
Replies (5)
Message 2 of 6

RPTHOMAS108
Mentor
Mentor
Accepted solution

Usually means your determinate is not 1.

 

You can't scale the basis in that way.

 

Transform.IsConformal from RevitAPI.chm

"This property is true if this transformation can be decomposed as the product of a rigid-body motion, uniform scale and reflection. Such transformation preserves angles between vectors"

Message 3 of 6

michellem
Advocate
Advocate

Hello RPTHOMAS108;

I saw your quoted text in a Google search before I posted my query here but unfortunately it did not make much sense to me. For example, what is a "determinate"? Or "rigid-body motion"?

 

At this point, I believe that by manipulating the values of the BasisX, BasisY, BasisZ you can move, rotate, mirror, or scale an object. Is this correct? Are there other actions that can be accomplished?

 

What values are legal for the BasisX, BasisY, or BasisZ? One possibility might be that any value is legal so long as the angle between BasisX & BasisY, and the angle between BasisX & BasisZ, and the angle between BasisX and BasisZ remain constant. Would that be correct?

 

Michelle

Message 4 of 6

RPTHOMAS108
Mentor
Mentor
Accepted solution

Rigid body motion means you cannot scale, skew, or shear the object to change it's shape or proportions etc.

 

The Transform has an underlying 4x4 matrix and the determinant of that is a single number (as you would calculate the determinant of any matrix). 

 

Fixed body motion means you can translate it, rotate it sometimes flip it etc. but not alter the body itself as noted above (can be moved about as a fixed sized and shaped thing).

 

The easiest way to create a valid transformation isn't by manually changing the underlying matrix values but instead using static methods of Transform class such as:

Transform.CreateReflection

Transform.CreateRotation

Transform.CreateRotationAtPoint

Transform.CreateTranslation

 

They can then be combined by Transform.Multiply

 

Each basis should be a normalised vector and generally result in a right handed system for most transformations (however that depends what you are using the transform for: elements, points, curves, solids and what API methods it is used with).

 

An example of a right handed system:

X pointing north east would be X = 0.7071, 0.7071, 0

Y would then have to be Y = -0.7071, 0.7071, 0

and Z = 0, 0, 1

 

if Z were instead 0, 0, -1 then the overall system described would be left handed and the determinant of the matrix would be -1, I believe. If the determinant is greater than 1 or has an absolute value less than 1 then it indicates scaling.

 

i.e. the vector length of each basis is 1 so the object does not undergo a change in shape or volume in any of the three directions.

 

In contrast if you compare the transforms in AutoCAD you have more freedom there for scaling but Revit is BIM and since you can't scale real world construction items etc. it isn't supported. Flipping and mirroring is supported to some extent.

Message 5 of 6

michellem
Advocate
Advocate

Hmm...thankyou for the explanation.

 

So what Revit means by "not comformal" is that the Transform matrix would distort the shape of the object being transformed and that this is not allowed. Would that be correct?

 

Can the determinate of a non-comformal matrix be calculated? Or would that be like trying to get the square root of a negative number? Or 1 divided by 0?

 


In contrast if you compare the transforms in AutoCAD you have more freedom there for scaling but Revit is BIM and since you can't scale real world construction items etc. it isn't supported. Flipping and mirroring is supported to some extent.


The above makes sense for 3d objects like walls, however I note that the Transform class has a ScaleBasis method. And I know the UserInterface of Revit allows scaling of 2D objects, so would I be correct in assuming that the Revit API allows scaling of 2D objects using a Transform object? (My work involves a lot of dead details.)

 


The easiest way to create a valid transformation isn't by manually changing the underlying matrix values but instead using static methods of Transform ...

This sounds like solid advice so I'll stick to the static methods...

Michelle

Message 6 of 6

RPTHOMAS108
Mentor
Mentor
Accepted solution

"So what Revit means by "not comformal" is that the Transform matrix would distort the shape of the object being transformed and that this is not allowed. Would that be correct?"

 

I don't really think in terms of conformal or non-conformal in my dealings with Transforms, conformal for me just means orthogonal and uniform in scale (I don't consider the meaning beyond that). You also need to remember that you do more with transforms than just changing positions of solids i.e. there is nothing stopping you from using Transform.OfPoint when the transform is non-conformal.

 

"Can the determinate of a non-comformal matrix be calculated"

 

Yes. You also get transform objects from certain API calls related to curves that return non-conformal transforms, an example being Curve.ComputeDerivatives (for a line).

 

"...so would I be correct in assuming that the Revit API allows scaling of 2D objects using a Transform object? "

 

You can scale the basis of the transform and that will then scale them uniformly meaning the transform will then remain conformal. You can probably apply that to a 2D curve to uniformly scale it. If you are scaling 2D curves then you have to keep in mind the curves should not grow outside their plane i.e if the curves are on the XY plane then they may not have a 0 value for Z i.e. they may exist on a level somewhere up the building. So if scaling the basis uniformly you will end up multiplying that Z value also pushing them outside their original plane. To avoid that you have to ensure your origin Z is bound to the plane making all the z values 0 so multiplying them via scaling has no effect in that direction. 

 

Transform can take any value but if it is non-conformal then the majority of transformation operations can't be done with it:

 

"Curve.CreateTransformed

ArgumentException : transform is not conformal

SolidUtils.CreateTransformed

ArgumentOutOfRangeException : transform is not conformal. -or- transform has a scale that is negative or zero."

Similar is written for Curveloop.

 

So you can scale some things such as curves uniformly in 2D but that isn't of that much use to you I assume i.e. if you had a rectangle template detail representing a window you don't want the two dimensions of it to be in the same proportions all the time.