mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add input surface scaling (issue #514)
- surfaceFeatureExtract * dictionary "scale" entry - triSurface - triSurfaceLoader * optional scaleFactor on reading - surfaceAdd - surfaceBooleanFeatures - surfaceClean - surfaceCoarsen * scale option - surfaceTransformPoints, transformPoints * scale option as scalar or vector quantity
This commit is contained in:
@ -218,7 +218,8 @@ Foam::label Foam::triSurfaceLoader::select(const wordReList& matcher)
|
||||
|
||||
Foam::autoPtr<Foam::triSurface> Foam::triSurfaceLoader::load
|
||||
(
|
||||
const enum loadingOption opt
|
||||
const enum loadingOption opt,
|
||||
const scalar scaleFactor
|
||||
) const
|
||||
{
|
||||
autoPtr<triSurface> output;
|
||||
@ -229,7 +230,8 @@ Foam::autoPtr<Foam::triSurface> Foam::triSurfaceLoader::load
|
||||
}
|
||||
else if (selected_.size() == 1)
|
||||
{
|
||||
output.set(new triSurface(directory_/selected_[0]));
|
||||
// Use scaling (if any)
|
||||
output.set(new triSurface(directory_/selected_[0], scaleFactor));
|
||||
|
||||
triSurface& surf = output();
|
||||
|
||||
@ -392,6 +394,12 @@ Foam::autoPtr<Foam::triSurface> Foam::triSurfaceLoader::load
|
||||
}
|
||||
}
|
||||
|
||||
// Apply scaling (if any)
|
||||
if (scaleFactor > VSMALL)
|
||||
{
|
||||
points *= scaleFactor;
|
||||
}
|
||||
|
||||
output.set(new triSurface(faces, patches, points, true));
|
||||
|
||||
return output;
|
||||
|
||||
@ -154,9 +154,12 @@ public:
|
||||
label select(const wordReList& matcher);
|
||||
|
||||
//- Load a single file, or load and combine multiple selected files
|
||||
// Optionally scale the surface(s) on input, with a zero or negative
|
||||
// scale factor treated as no scaling.
|
||||
autoPtr<triSurface> load
|
||||
(
|
||||
const enum loadingOption opt = loadingOption::OFFSET_REGION
|
||||
const enum loadingOption opt = loadingOption::OFFSET_REGION,
|
||||
const scalar scaleFactor = -1
|
||||
) const;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user