Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom polygon generation #597

Closed
hirenj opened this issue Sep 24, 2019 · 1 comment
Closed

Custom polygon generation #597

hirenj opened this issue Sep 24, 2019 · 1 comment

Comments

@hirenj
Copy link

hirenj commented Sep 24, 2019

To generate a custom polygon shape, it looks like a minimal XML chunk would look a bit like this:

<p:sp>
	<p:nvSpPr>
		<p:cNvPr id="SOMEIDNUMBER" name="OBJECTNAME"/>
		<p:cNvSpPr/>
		<p:nvPr/>
	</p:nvSpPr>
	<p:spPr>
		<a:xfrm>
			<!-- x and y position of shape -->
			<a:off x="2917861" y="585627"/>
			<!-- width and height of shape -->
			<a:ext cx="2732926" cy="1705510"/>
		</a:xfrm>
		<a:custGeom>
			<a:avLst/>
			<a:gdLst/>
			<a:ahLst/>
			<a:cxnLst/>
			<a:pathLst>
				<a:path>
					<a:moveTo>
						<a:pt x="904126" y="0"/>
					</a:moveTo>
					<a:lnTo>
						<a:pt x="2732926" y="657546"/>
					</a:lnTo>
					<a:lnTo>
						<a:pt x="1952090" y="1705510"/>
					</a:lnTo>
					<a:lnTo>
						<a:pt x="297950" y="1664413"/>
					</a:lnTo>
					<a:lnTo>
						<a:pt x="0" y="708917"/>
					</a:lnTo>
					<a:lnTo>
						<a:pt x="904126" y="0"/>
					</a:lnTo>
					<a:close/>
				</a:path>
			</a:pathLst>
		</a:custGeom>
		<a:solidFill>
		<a:srgbClr val="FF0000"/>
		</a:solidFill>
	</p:spPr>
</p:sp>

There's also arcTo,cubicBezTo and quadBezTo. It seems like it would be possible to convert an SVG path definition to this path definition (if a width/height was passed along too). This is just enough to get a shape displayed but is missing definitions for shape handles etc.

a:off and a:ext can be minimised (cx and cy for a:ext set to 1, and x/y set to 0 for a:off) but that means that the point positions need to be absolute, and the bounding box on selection of the object is off (which is an ok artefact to have I think).

@gitbrent
Copy link
Owner

Implemented vai #872

gitbrent added a commit that referenced this issue Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants