forked from 1b-agent/opencadstudio-upstream
Complete Ole2Frame: embed a picture file from a script
EmbedPicture builds the frame with OCS's own EmbeddedImage and build_embedded_ole, so the opaque storage is never scripted. PNG, JPEG and BMP are stored as read and other formats are re-encoded as PNG. The lifecycle test now creates through Python; a new test covers formats, aspect, origin, layer and refusals. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
942222c381
commit
5e6a830782
8 files changed
+148
-7
No files matched your search
@@ -109,6 +109,11 @@ pub enum SolidOperation {
|
||||
/// layer. The kernel refuses some cases (coincident faces, cuts it has no
|
||||
/// closed form for); a refusal changes nothing. Curved operands can take a
|
||||
/// second or two, and the host thread is busy meanwhile.
|
||||
/// Embed a picture file as an OLE frame whose bottom-left corner is at
|
||||
/// `origin`, `width` drawing units wide, keeping the picture's aspect.
|
||||
/// PNG, JPEG and BMP are stored as read; other formats are re-encoded as
|
||||
/// PNG. The frame goes on `layer` (layer `0` when `None`).
|
||||
EmbedPicture { path: String, origin: [f64; 3], width: f64, layer: Option<String> },
|
||||
Boolean {
|
||||
first: Handle,
|
||||
second: Handle,
|
||||
|
||||
@@ -115,6 +115,7 @@ mod tests {
|
||||
},
|
||||
SolidOperation::Transform { handle: acadrust::Handle::new(7), matrix: [1.0; 16] },
|
||||
SolidOperation::RegionFromProfile { source: acadrust::Handle::new(3), layer: None, delete_source: true },
|
||||
SolidOperation::EmbedPicture { path: "p.png".into(), origin: [0.0; 3], width: 5.0, layer: None },
|
||||
SolidOperation::Boolean {
|
||||
first: acadrust::Handle::new(1),
|
||||
second: acadrust::Handle::new(2),
|
||||
|
||||
Reference in new issue
Block a user